summaryrefslogtreecommitdiffstats
path: root/llvm/unittests
Commit message (Collapse)AuthorAgeFilesLines
* [MCJIT] Unique-ptrify the RTDyldMemoryManager member of MCJIT. NFC.Lang Hames2014-12-032-4/+4
| | | | llvm-svn: 223183
* DebugIR: Delete -debug-irDuncan P. N. Exon Smith2014-11-295-334/+1
| | | | llvm-svn: 222945
* Cleaning out google tests from MC.Colin LeMahieu2014-11-253-73/+0
| | | | llvm-svn: 222770
* More long path name support on Windows, this time in program execution.Paul Robinson2014-11-241-0/+50
| | | | | | | Allows long paths for the executable and redirected stdin/stdout/stderr. Addresses PR21563. llvm-svn: 222671
* Support: Add *cast_or_null<> for pointer wrappersDuncan P. N. Exon Smith2014-11-241-0/+96
| | | | | | | | | | | | | | | | | | | | Fill in omission of `cast_or_null<>` and `dyn_cast_or_null<>` for types that wrap pointers (e.g., smart pointers). Type traits need to be slightly stricter than for `cast<>` and `dyn_cast<>` to resolve ambiguities with simple types. There didn't seem to be any unit tests for pointer wrappers, so I tested `isa<>`, `cast<>`, and `dyn_cast<>` while I was in there. This only supports pointer wrappers with a conversion to `bool` to check for null. If in the future it's useful to support wrappers without such a conversion, it should be a straightforward incremental step to use the `simplify_type` machinery for the null check. In that case, the unit tests should be updated to remove the `operator bool()` from the `pointer_wrappers::PTy`. llvm-svn: 222644
* Fix a silly bug in StreamingMemoryObject.cpp.Rafael Espindola2014-11-212-0/+31
| | | | | | | The logic for detecting EOF was wrong and would fail if we ever requested more than 16k past the last read position. llvm-svn: 222505
* Compilation test for PostOrderIterator.Michael Ilseman2014-11-202-0/+38
| | | | | | | | | If the template specialization for externally managed sets in PostOrderIterator call too far out of sync with each other, this unit test will fail to build. This is especially useful for developers who may not build Clang (the only in-tree user) every time. llvm-svn: 222447
* Remove support for undocumented SpecialCaseList entries.Alexey Samsonov2014-11-201-19/+1
| | | | | | | | | | | | | "global-init", "global-init-src" and "global-init-type" were originally used to blacklist entities in ASan init-order checker. However, they were never documented, and later were replaced by "=init" category. Old blacklist entries should be converted as follows: * global-init:foo -> global:foo=init * global-init-src:bar -> src:bar=init * global-init-type:baz -> type:baz=init llvm-svn: 222401
* [ADT] Fix PR20728 - Incorrect APFloat::fusedMultiplyAdd results for x86_fp80.Lang Hames2014-11-191-0/+12
| | | | | | | | | | | | | | As detailed at http://llvm.org/PR20728, due to an internal overflow in APFloat::multiplySignificand the APFloat::fusedMultiplyAdd method can return incorrect results for x87DoubleExtended (x86_fp80) values. This commonly manifests as incorrect constant folding of libm fmal calls on x86. E.g. fmal(1.0L, 1.0L, 3.0L) == 0.0L (should be 4.0L) This patch fixes PR20728 by adding an extra bit to the significand for intermediate results of APFloat::multiplySignificand, avoiding the overflow. llvm-svn: 222374
* Remove StringMap::GetOrCreateValue in favor of StringMap::insertDavid Blaikie2014-11-191-6/+4
| | | | | | | | | | | | | | Having two ways to do this doesn't seem terribly helpful and consistently using the insert version (which we already has) seems like it'll make the code easier to understand to anyone working with standard data structures. (I also updated many references to the Entry's key and value to use first() and second instead of getKey{Data,Length,} and get/setValue - for similar consistency) Also removes the GetOrCreateValue functions so there's less surface area to StringMap to fix/improve/change/accommodate move semantics, etc. llvm-svn: 222319
* CallGraphTest.cpp: Remove invalid tests. ++S might step over F if S == F.NAKAMURA Takumi2014-11-181-3/+0
| | | | | | MSVC Runtime detects "Assertion failed: vector iterator not incrementable" llvm-svn: 222233
* Fix the autoconf build.Rafael Espindola2014-11-171-1/+1
| | | | llvm-svn: 222173
* Factor common code it Linker::init.Rafael Espindola2014-11-172-0/+21
| | | | | | The TypeFinder was not being used in one of the constructors. llvm-svn: 222172
* Fix GraphTraits for "const CallGraphNode *" and "const CallGraph *"Rafael Espindola2014-11-173-1/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | The specializations were broken. For example, void foo(const CallGraph *G) { auto I = GraphTraits<const CallGraph *>::nodes_begin(G); auto K = I++; ... } or void bar(const CallGraphNode *N) { auto I = GraphTraits<const CallGraphNode *>::nodes_begin(G); auto K = I++; .... } would not compile. Patch by Speziale Ettore! llvm-svn: 222149
* Dispose disassembler after use in unit test.Benjamin Kramer2014-11-151-0/+2
| | | | llvm-svn: 222083
* StringMap: Test and finish off supporting perfectly forwarded values in ↵David Blaikie2014-11-141-1/+15
| | | | | | | | StringMap operations. Followup to r221946. llvm-svn: 221958
* Fix the other build system.Rafael Espindola2014-11-131-1/+1
| | | | llvm-svn: 221901
* Fix a regression on the disassembling C API.Rafael Espindola2014-11-132-0/+65
| | | | | | | | | The fix is easy. Unfortunately, we had 0 tests, so adding one was somewhat complicated. Thanks to Kevin Enderby for the report. llvm-svn: 221899
* Fixing some sign comparison warnings from MSVC; NFC.Aaron Ballman2014-11-131-3/+3
| | | | llvm-svn: 221887
* Drop a few unneeded ctor calls (missed code review comment).Paul Robinson2014-11-131-4/+4
| | | | llvm-svn: 221845
* Improve long path name support on Windows.Paul Robinson2014-11-131-2/+59
| | | | | | | | | | Windows normally limits the length of an absolute path name to 260 characters; directories can have lower limits. These limits increase to about 32K if you use absolute paths with the special '\\?\' prefix. Teach Support\Windows\Path.inc to use that prefix as needed. TODO: Other parts of Support could also learn to use this prefix. llvm-svn: 221841
* [Bitcode] AtEndOfStream should only check against the size if it's known.Jordan Rose2014-11-132-0/+57
| | | | | | | | | | This avoids an issue where AtEndOfStream mistakenly returns true at the /start/ of a stream. (In the rare case that the size is known and actually 0, the slow path will still handle it correctly.) llvm-svn: 221840
* Ensure function_refs are copyable even from non-const referencesDavid Blaikie2014-11-122-0/+29
| | | | | | | | | | | | | | | | | | A subtle bug was found where attempting to copy a non-const function_ref lvalue would actually invoke the generic forwarding constructor (as it was a closer match - being T& rather than the const T& of the implicit copy constructor). In the particular case this lead to a dangling function_ref member (since it had referenced the function_ref passed by value to its ctor, rather than the outer function_ref that was still alive) SFINAE the converting constructor to not be considered if the copy constructor is available and demonstrate that this causes the copy to refer to the original functor, not to the function_ref it was copied from. (without the code change, the test would fail as Y would be referencing X and Y() would see the result of the mutation to X, ie: 2) llvm-svn: 221753
* [CMake] LLVMSupport: Give system_libs PRIVATE scope when LLVMSupport is ↵NAKAMURA Takumi2014-11-071-0/+5
| | | | | | | | built as SHARED. Users of LLVMSupport won't inherit ${system_libs}. unittests/SupporTests is another user of libpthreads. Apply LLVM_SYSTEM_LIBS for him explicitly. llvm-svn: 221531
* [Hexagon] Reverting 220584 to address ASAN errors.Colin LeMahieu2014-11-042-0/+59
| | | | llvm-svn: 221210
* Remove the PreserveSource linker mode.Rafael Espindola2014-10-281-11/+15
| | | | | | | | | | | | | | | | | | | | I noticed that it was untested, and forcing it on caused some tests to fail: LLVM :: Linker/metadata-a.ll LLVM :: Linker/prefixdata.ll LLVM :: Linker/type-unique-odr-a.ll LLVM :: Linker/type-unique-simple-a.ll LLVM :: Linker/type-unique-simple2-a.ll LLVM :: Linker/type-unique-simple2.ll LLVM :: Linker/type-unique-type-array-a.ll LLVM :: Linker/unnamed-addr1-a.ll LLVM :: Linker/visibility1.ll If it is to be resurrected, it has to be fixed and we should probably have a -preserve-source command line option in llvm-mc and run tests with and without it. llvm-svn: 220741
* Add MapVector::rbegin(), MapVector::rend() to completment ↵Michael Gottesman2014-10-271-0/+25
| | | | | | | | | | MapVector::begin(), MapVector::end(). These just delegate to the underlying vector type in the MapVector. Also just add in some sanity unittests. llvm-svn: 220687
* Update the error handling of lib/Linker.Rafael Espindola2014-10-251-3/+3
| | | | | | Instead of passing a std::string&, use the new diagnostic infrastructure. llvm-svn: 220608
* Modernize the error handling of the Materialize function.Rafael Espindola2014-10-241-3/+3
| | | | llvm-svn: 220600
* [Hexagon] Resubmission of 220427Colin LeMahieu2014-10-242-59/+0
| | | | | | | | | | | Modified library structure to deal with circular dependency between HexagonInstPrinter and HexagonMCInst. Adding encoding bits for add opcode. Adding llvm-mc tests. Removing unit tests. http://reviews.llvm.org/D5624 llvm-svn: 220584
* Add unittest for extreme alignments.Rafael Espindola2014-10-231-0/+23
| | | | llvm-svn: 220483
* [CMake] Prune trailing whitespace.NAKAMURA Takumi2014-10-231-1/+1
| | | | llvm-svn: 220479
* Revert r220427, "[Hexagon] Adding encoding bits for add opcode."NAKAMURA Takumi2014-10-232-0/+59
| | | | | | It brought cyclic dependecy between HexagonAsmPrinter and HexagonDesc. llvm-svn: 220478
* [MCJIT] Make repeat calls to MCJIT::getPointerToFunction for declarations safe.Lang Hames2014-10-222-0/+21
| | | | | | | | | | | | | | MCJIT::getPointerForFunction adds the resulting address to the global mapping. This should be done via updateGlobalMapping rather than addGlobalMapping, since the latter asserts if a mapping already exists. MCJIT::getPointerToFunction is actually deprecated - hopefully we can remove it (or more likely re-task it) entirely soon. In the mean time it should at least work as advertised. <rdar://problem/18727946> llvm-svn: 220444
* [Hexagon] Adding encoding bits for add opcode.Colin LeMahieu2014-10-222-59/+0
| | | | | | | | | Adding llvm-mc tests. Removing unit tests. http://reviews.llvm.org/D5624 llvm-svn: 220427
* Silence gcc's -WcommentFilipe Cabecinhas2014-10-221-15/+17
| | | | | | | | gcc's (4.7, I think) -Wcomment warning is not "as smart" as clang's and warns even if the line right after the backslash-newline sequence only has a line comment that starts at the beginning of the line. llvm-svn: 220360
* Silence a -Wcast-qual warning; NFC.Aaron Ballman2014-10-211-1/+1
| | | | llvm-svn: 220300
* [ADT] Add a 'find_as' operation to DenseSet.Lang Hames2014-10-191-0/+38
| | | | | | | | | | This operation is analogous to its counterpart in DenseMap: It allows lookup via cheap-to-construct keys (provided that getHashValue and isEqual are implemented for the cheap key-type in the DenseMapInfo specialization). Thanks to Chandler for the review. llvm-svn: 220168
* [ADT] Add an (ADL-friendly) abs free function for APFloat that returnsChandler Carruth2014-10-101-0/+38
| | | | | | by value having cleared the sign bit. llvm-svn: 219485
* Add minnum / maxnum to APFloatMatt Arsenault2014-10-101-0/+22
| | | | llvm-svn: 219475
* [ADT] Replace the logb implementation with the simpler and much closerChandler Carruth2014-10-101-49/+27
| | | | | | | | to what we actually want ilogb implementation. This makes everything *much* easier to deal with and is actually what we want when using it anyways. llvm-svn: 219474
* [ADT] Add the scalbn function for APFloat.Chandler Carruth2014-10-101-0/+43
| | | | llvm-svn: 219473
* [ADT] Implement the 'logb' functionality for APFloat. This is necessaryChandler Carruth2014-10-101-0/+51
| | | | | | to implement complex division in the constant folder of Clang. llvm-svn: 219471
* [ADT] Add basic operator overloads for arithmetic to APFloat to makeChandler Carruth2014-10-091-0/+20
| | | | | | | | | | | | code using it more readable. Also add a copySign static function that works more like the standard function by accepting the value and sign-carying value as arguments. No interesting logic here, but tests added to cover the basic API additions and make sure they do something plausible. llvm-svn: 219453
* [Support] Add MemoryBuffer::getFileSlice()Nick Kledzik2014-10-081-0/+50
| | | | | | | | | | mach-o supports "fat" files which are a header/table-of-contents followed by a concatenation of mach-o files built for different architectures. Currently, MemoryBuffer has no easy way to map a subrange (slice) of a file which lld will need to select a mach-o slice of a fat file. The new function provides an easy way to map a slice of a file into a MemoryBuffer. Test case included. llvm-svn: 219260
* Add return value and negative checks to MapVector::erase from r219240.Kaelyn Takata2014-10-071-1/+4
| | | | llvm-svn: 219250
* Add size_t MapVector::erase(KeyT) similar to the one in std::map.Kaelyn Takata2014-10-071-0/+5
| | | | llvm-svn: 219240
* [CMake] HexagonTests: Update LINK_COMPONENTS.NAKAMURA Takumi2014-10-051-0/+4
| | | | llvm-svn: 219072
* Add unit tests to verify Hexagon emission.Sid Manning2014-10-032-0/+63
| | | | | | | Add the test cases I overlooked, part of the original commit, http://reviews.llvm.org/D5523 llvm-svn: 219016
* Revert "Revert "DI: Fold constant arguments into a single MDString""Duncan P. N. Exon Smith2014-10-032-0/+69
| | | | | | | | | | | | | | | | | | | | | | This reverts commit r218918, effectively reapplying r218914 after fixing an Ocaml bindings test and an Asan crash. The root cause of the latter was a tightened-up check in `DILexicalBlock::Verify()`, so I'll file a PR to investigate who requires the loose check (and why). Original commit message follows. -- This patch addresses the first stage of PR17891 by folding constant arguments together into a single MDString. Integers are stringified and a `\0` character is used as a separator. Part of PR17891. Note: I've attached my testcases upgrade scripts to the PR. If I've just broken your out-of-tree testcases, they might help. llvm-svn: 219010
OpenPOWER on IntegriCloud