aboutsummaryrefslogtreecommitdiffstats
path: root/unittests
Commit message (Collapse)AuthorAgeFilesLines
...
* Change MemoryBuffer::getFile to take a Twine.Rafael Espindola2013-10-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193429 91177308-0d34-0410-b5e6-96231b3b80d8
* DIEHash: Summary hashing of nested typesDavid Blaikie2013-10-251-0/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193427 91177308-0d34-0410-b5e6-96231b3b80d8
* DIEHash: Const correct and use references where non-null/non-rebound.David Blaikie2013-10-241-16/+16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193363 91177308-0d34-0410-b5e6-96231b3b80d8
* DIEHash: Do not use shallow type hashing for unnamed typesDavid Blaikie2013-10-241-0/+35
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193361 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting my r193344 checkin due to build breakage.John Thompson2013-10-241-31/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193350 91177308-0d34-0410-b5e6-96231b3b80d8
* Added std::string as a built-in type for mapping.John Thompson2013-10-241-0/+31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193344 91177308-0d34-0410-b5e6-96231b3b80d8
* DWARF type hashing: pointers to membersDavid Blaikie2013-10-221-0/+178
| | | | | | | | | Includes a test case/FIXME demonstrating a bug/limitation in pointer to member hashing. To be honest I'm not sure why we don't just always use summary hashing for referenced types... but perhaps I'm missing something. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193175 91177308-0d34-0410-b5e6-96231b3b80d8
* DWARF Type Hashing: Include reference and rvalue reference type in the ↵David Blaikie2013-10-211-0/+66
| | | | | | | | declarable summary hashing path More support for 7.25 Part 5. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193129 91177308-0d34-0410-b5e6-96231b3b80d8
* DWARF type hashing: begin implementing Step 5, summary hashing in declarable ↵David Blaikie2013-10-211-6/+35
| | | | | | | | | contexts There are several other tag types that need similar handling but to ensure test coverage they'll be coming incrementally. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193126 91177308-0d34-0410-b5e6-96231b3b80d8
* Removing unnecessary link component for MCJIT unittestsAndrew Kaylor2013-10-212-2/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193125 91177308-0d34-0410-b5e6-96231b3b80d8
* DIEHashTest: Correct the order of operands to the TEST macroDavid Blaikie2013-10-211-7/+7
| | | | | | And add the 'Test' suffix so the test case name matches the file name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193119 91177308-0d34-0410-b5e6-96231b3b80d8
* DWARF type hashing: Handle multiple (including recursive) references to the ↵David Blaikie2013-10-211-1/+58
| | | | | | | | | | same type This uses a map, keeping the type DIE numbering separate from the DIEs themselves - alternatively we could do things the way GCC does if we want to add an integer to the DIE type to record the numbering there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193105 91177308-0d34-0410-b5e6-96231b3b80d8
* DIEHash: Support for simple (non-recursive, non-reused) type referencesDavid Blaikie2013-10-171-7/+29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192924 91177308-0d34-0410-b5e6-96231b3b80d8
* DIEHash: Include the type's context in the type hash.David Blaikie2013-10-171-7/+56
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192856 91177308-0d34-0410-b5e6-96231b3b80d8
* DIEHash: Use DW_FORM_sdata for integers, per spec.David Blaikie2013-10-161-1/+17
| | | | | | | This allows us to produce the same hash as GCC for at least some simple examples. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192855 91177308-0d34-0410-b5e6-96231b3b80d8
* Invert arguments to ASSERT_EQ to match gtest diagnostic printingDavid Blaikie2013-10-161-1/+1
| | | | | | | | GTest assumes the left hand side of the assert is the expectation and the right hand side is the test result. It's easier to read gtest failures when these things are ordered correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192854 91177308-0d34-0410-b5e6-96231b3b80d8
* DIEHash: Include the trailing zero byte after the children of a DIEDavid Blaikie2013-10-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192836 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix MCDataAtom never calling remap when adding data.Rafael Espindola2013-10-165-1/+59
| | | | | | | | | | | | | | | | This patch fixes a small mistake in MCDataAtom::addData() where it doesn't ever call remap(): - if (Data.size() > Begin - End - 1) + if (Data.size() > End + 1 - Begin) remap(Begin, End + 1); This is currently not visible because of another bug is the disassembler, so the patch includes a unit test. Patch by Stephen Checkoway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192823 91177308-0d34-0410-b5e6-96231b3b80d8
* Assert on duplicate registration. Don't depend on function pointer equality.Rafael Espindola2013-10-161-12/+0
| | | | | | | | | | | | | | | | | | | | Before this patch we would assert when building llvm as multiple shared libraries (cmake's BUILD_SHARED_LIBS). The problem was the line if (T.AsmStreamerCtorFn == Target::createDefaultAsmStreamer) which returns false because of -fvisibility-inlines-hidden. It is easy to fix just this one case, but I decided to try to also make the registration more strict. It looks like the old logic for ignoring followup registration was just a temporary hack that outlived its usefulness. This patch converts the ifs to asserts, fixes the few cases that were registering twice and makes sure all the asserts compare with null. Thanks for Joerg for reporting the problem and reviewing the patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192803 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ASSERT_EQ rather than ASSERT_TRUE for better unit test failures.David Blaikie2013-10-151-3/+3
| | | | | | | Also minor using namespace move so it's not hard-up against the function definition and outside the namespace as is usual. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192744 91177308-0d34-0410-b5e6-96231b3b80d8
* Silencing an MSVC warning.Aaron Ballman2013-10-051-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192042 91177308-0d34-0410-b5e6-96231b3b80d8
* MCJIT: skip some more new multi-module tests on unsupported platforms.Tim Northover2013-10-021-0/+8
| | | | | | This should fix the i386 Darwin build-bot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191840 91177308-0d34-0410-b5e6-96231b3b80d8
* This threads SectionName through the allocateCodeSection/allocateDataSection ↵Filip Pizlo2013-10-024-26/+32
| | | | | | | | | | | | | | | | | | | | APIs, both in C++ and C land. It's useful for the memory managers that are allocating a section to know what the name of the section is. At a minimum, this is useful for low-level debugging - it's customary for JITs to be able to tell you what memory they allocated, and as part of any such dump, they should be able to tell you some meta-data about what each allocation is for. This allows clients that supply their own memory managers to do this. Additionally, we also envision the SectionName being useful for passing meta-data from within LLVM to an LLVM client. This changes both the C and C++ APIs, and all of the clients of those APIs within LLVM. I'm assuming that it's safe to change the C++ API because that API is allowed to change. I'm assuming that it's safe to change the C API because we haven't shipped the API in a release yet (LLVM 3.3 doesn't include the MCJIT memory management C API). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191804 91177308-0d34-0410-b5e6-96231b3b80d8
* Add non-blocking Wait() for launched processesTareq A. Siraj2013-10-011-0/+103
| | | | | | | | | | | | | | | | | | - New ProcessInfo class to encapsulate information about child processes. - Generalized the Wait() to support non-blocking wait on child processes. - ExecuteNoWait() now returns a ProcessInfo object with information about the launched child. Users will be able to use this object to perform non-blocking wait. - ExecuteNoWait() now accepts an ExecutionFailed param that tells if execution failed or not. These changes will allow users to implement basic process parallel tools. Differential Revision: http://llvm-reviews.chandlerc.com/D1728 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191763 91177308-0d34-0410-b5e6-96231b3b80d8
* Tests for MCJIT multiple module supportAndrew Kaylor2013-10-014-75/+556
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191723 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix getOrInsertGlobal dropping the address space.Matt Arsenault2013-09-301-0/+40
| | | | | | | | Currently it will insert an illegal bitcast. Arguably, the address space argument should be added for the creation case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191702 91177308-0d34-0410-b5e6-96231b3b80d8
* IRBuilder: Add RAII objects to reset insertion points or fast math flags.Benjamin Kramer2013-09-301-0/+36
| | | | | | | | Inspired by the object from the SLPVectorizer. This found a minor bug in the debug loc restoration in the vectorizer where the location of a following instruction was attached instead of the location from the original instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191673 91177308-0d34-0410-b5e6-96231b3b80d8
* Plug a memory leak in a unit test. Stack allocation is sufficient here.Benjamin Kramer2013-09-291-5/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191638 91177308-0d34-0410-b5e6-96231b3b80d8
* SourceMgr diagnotics printing: fix a bug where printing a fixit for a sourceDmitri Gribenko2013-09-271-0/+12
| | | | | | | | range that includes a tab character will cause out-of-bounds access to the fixit string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191563 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SourceMgr::PrintMessage() testable and add unit testsDmitri Gribenko2013-09-272-0/+163
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191558 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed typo in CreateProcessTrailingSlash testTareq A. Siraj2013-09-201-1/+1
| | | | | | | | | --gtest_filter was filtering an invalid name for the test. Differential Revision: http://llvm-reviews.chandlerc.com/D1733 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191100 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-submit r190469: YAMLIO: Fix string quoting logic.Rui Ueyama2013-09-111-0/+57
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190485 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "YAMLIO: Fix string quoting logic." (r190469)Hans Wennborg2013-09-111-57/+0
| | | | | | It was turning the buildbots red. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190480 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceRui Ueyama2013-09-111-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190472 91177308-0d34-0410-b5e6-96231b3b80d8
* YAMLIO: Fix string quoting logic.Rui Ueyama2013-09-111-0/+57
| | | | | | | | YAMLIO printed a string as is without quotes unless it contains a newline character. That did not suffice. We also need to quote a string if it starts with a backquote, quote, double quote or atsign, or it's the empty string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190469 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to unbreak mingw32 buildbot.Rui Ueyama2013-09-101-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190438 91177308-0d34-0410-b5e6-96231b3b80d8
* Add getenv() wrapper that works on multibyte environment variable.Rui Ueyama2013-09-101-0/+28
| | | | | | | | | | | | | | | | | | On Windows, character encoding of multibyte environment variable varies depending on settings. The only reliable way to handle it I think is to use GetEnvironmentVariableW(). GetEnvironmentVariableW() works on wchar_t string, which is on Windows UTF16 string. That's not ideal because we use UTF-8 as the internal encoding in LLVM. This patch defines a wrapper function which takes and returns UTF-8 string for GetEnvironmentVariableW(). The wrapper function does not do any conversion and just forwards the argument to getenv() on Unix. Differential Revision: http://llvm-reviews.chandlerc.com/D1612 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190423 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CMake file to fix buildbots.Bob Wilson2013-09-091-1/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190331 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert patches to add case-range support for PR1255.Bob Wilson2013-09-092-326/+1
| | | | | | | | | | | | | | | | | The work on this project was left in an unfinished and inconsistent state. Hopefully someone will eventually get a chance to implement this feature, but in the meantime, it is better to put things back the way the were. I have left support in the bitcode reader to handle the case-range bitcode format, so that we do not lose bitcode compatibility with the llvm 3.3 release. This reverts the following commits: 155464, 156374, 156377, 156613, 156704, 156757, 156804 156808, 156985, 157046, 157112, 157183, 157315, 157384, 157575, 157576, 157586, 157612, 157810, 157814, 157815, 157880, 157881, 157882, 157884, 157887, 157901, 158979, 157987, 157989, 158986, 158997, 159076, 159101, 159100, 159200, 159201, 159207, 159527, 159532, 159540, 159583, 159618, 159658, 159659, 159660, 159661, 159703, 159704, 160076, 167356, 172025, 186736 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190328 91177308-0d34-0410-b5e6-96231b3b80d8
* MemoryBufer: add a test: check that a file with size that is a multiple of theDmitri Gribenko2013-09-041-0/+22
| | | | | | | page size can be null terminated correctly by MemoryBuffer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189965 91177308-0d34-0410-b5e6-96231b3b80d8
* Move generic isPrint and columnWidth implementations to a separate ↵Alexander Kornienko2013-09-043-105/+94
| | | | | | | | | | | | | | | | | | | | | header/source to allow using both generic and system-dependent versions on win32. Summary: This is needed so we can use generic columnWidthUTF8 in clang-format on win32 simultaneously with a separate system-dependent implementations of isPrint/columnWidth in TextDiagnostic.cpp to avoid attempts to print Unicode characters using narrow-character interfaces (which is not supported on Windows, and we'll have to figure out how to handle this). Reviewers: jordan_rose Reviewed By: jordan_rose CC: llvm-commits, klimek Differential Revision: http://llvm-reviews.chandlerc.com/D1559 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189952 91177308-0d34-0410-b5e6-96231b3b80d8
* It's a very large constant. Say so.Eric Christopher2013-09-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189899 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix copy and pasto with CMake files for unittest.Eric Christopher2013-09-031-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189863 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a hashing routine that handles hashing types. Add a test forEric Christopher2013-09-035-2/+61
| | | | | | hashing the contents of DW_FORM_data1 on top of a type with attributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189862 91177308-0d34-0410-b5e6-96231b3b80d8
* Alphabetize.Eric Christopher2013-09-031-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189848 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a Python-like join function to merge a list of strings with aJoerg Sonnenberger2013-09-031-0/+27
| | | | | | | separator between each two elements. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189846 91177308-0d34-0410-b5e6-96231b3b80d8
* Change default # of digits for APFloat::toStringEli Friedman2013-08-291-4/+5
| | | | | | | | | | | | | | | | | This is a re-commit of r189442; I'll follow up with clang changes. The previous default was almost, but not quite enough digits to represent a floating-point value in a manner which preserves the representation when it's read back in. The larger default is much less confusing. I spent some time looking into printing exactly the right number of digits if a precision isn't specified, but it's kind of complicated, and I'm not really sure I understand what APFloat::toString is supposed to output for FormatPrecision != 0 (or maybe the current API specification is just silly, not sure which). I have a WIP patch if anyone is interested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189624 91177308-0d34-0410-b5e6-96231b3b80d8
* Option parsing: support case-insensitive option matching.Rui Ueyama2013-08-281-3/+23
| | | | | | Re-submitting r189416 with fix for Windows build on where strcasecmp is not defined. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189501 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r189442 "Change default # of digits for APFloat::toString"Ted Kremenek2013-08-281-5/+4
| | | | | | This is breaking numerous Clang tests on the buildbot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189447 91177308-0d34-0410-b5e6-96231b3b80d8
* Change default # of digits for APFloat::toStringEli Friedman2013-08-281-4/+5
| | | | | | | | | | | | | | | The previous default was almost, but not quite enough digits to represent a floating-point value in a manner which preserves the representation when it's read back in. The larger default is much less confusing. I spent some time looking into printing exactly the right number of digits if a precision isn't specified, but it's kind of complicated, and I'm not really sure I understand what APFloat::toString is supposed to output for FormatPrecision != 0 (or maybe the current API specification is just silly, not sure which). I have a WIP patch if anyone is interested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189442 91177308-0d34-0410-b5e6-96231b3b80d8