summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
* Fix EXPECT_* to not produce a compile warning.Eli Bendersky2014-03-07
| | | | | | | EXPECT_TRUE/FALSE is also more idiomatic for booleans than EXPECT_EQ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203284 91177308-0d34-0410-b5e6-96231b3b80d8
* [ADT] Update PointerIntPair to handle pointer types with more than 31 bits free.Jordan Rose2014-03-07
| | | | | | | | | | Previously, the assertions in PointerIntPair would try to calculate the value (1 << NumLowBitsAvailable); the inferred type here is 'int', so if there were more than 31 bits available we'd get a shift overflow. Also, add a rudimentary unit test file for PointerIntPair. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203273 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Now that the users are gone, rip out the duplicated traits from ↵Benjamin Kramer2014-03-07
| | | | | | | | type_traits.h Simplify the remaining ones a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203249 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace LLVM-style type traits with C++11 standard ones.Benjamin Kramer2014-03-07
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203242 91177308-0d34-0410-b5e6-96231b3b80d8
* Support: split object format out of environmentSaleem Abdulrasool2014-03-06
| | | | | | | | | | | This is a preliminary setup change to support a renaming of Windows target triples. Split the object file format information out of the environment into a separate entity. Unfortunately, file format was previously treated as an environment with an unknown OS. This is most obvious in the ARM subtarget where the handling for macho on an arbitrary platform switches to AAPCS rather than APCS (as per Apple's needs). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203160 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-06
| | | | | | | | | | This compiles with no changes to clang/lld/lldb with MSVC and includes overloads to various functions which are used by those projects and llvm which have OwningPtr's as parameters. This should allow out of tree projects some time to move. There are also no changes to libs/Target, which should help out of tree targets have time to move, if necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203083 91177308-0d34-0410-b5e6-96231b3b80d8
* [Layering] Sink Linker.h into a Linker subdirectory to make itChandler Carruth2014-03-06
| | | | | | consistent with every other sub-library header in LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203065 91177308-0d34-0410-b5e6-96231b3b80d8
* [Layering] Move DebugInfo.h into the IR library where its implementationChandler Carruth2014-03-06
| | | | | | already lives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203046 91177308-0d34-0410-b5e6-96231b3b80d8
* [Layering] Move DIBuilder.h into the IR library where its implementationChandler Carruth2014-03-06
| | | | | | already lives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203038 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an inconsistency in treatment of trailing / in path::const_iteratorBen Langmuir2014-03-05
| | | | | | | | | When using a //net/ path, we were transforming the trailing / into a '.' when the path was just the root path and we were iterating backwards. Forwards iteration and other kinds of root path (C:\, /) were already correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202999 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add overloads for externally used OwningPtr functions.Ahmed Charles2014-03-05
| | | | | | | | This will allow external callers of these functions to switch over time rather than forcing a breaking change all a once. These particular functions were determined by building clang/lld/lldb. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202959 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace OwningPtr::take() with OwningPtr::release().Ahmed Charles2014-03-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202957 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add release() to OwningPtr.Ahmed Charles2014-03-05
| | | | | | | This will make the transition to unique_ptr easier by allowing more incremental changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202949 91177308-0d34-0410-b5e6-96231b3b80d8
* Hey, we can stop depending on the IR library from the Support unittestsChandler Carruth2014-03-04
| | | | | | | now. ;] Tested on both a static and shared CMake build. Hopefully the bots will agree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202844 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Move the LeakDetector header into the IR library where theChandler Carruth2014-03-04
| | | | | | | | | | | source file had already been moved. Also move the unittest into the IR unittest library. This may seem an odd thing to put in the IR library but we only really use this with instructions and it needs the LLVM context to work, so it is intrinsically tied to the IR library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202842 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Move the ConstantRange class into the IR library. This isChandler Carruth2014-03-04
| | | | | | | | | | a bit surprising, as the class is almost entirely abstracted away from any particular IR, however it encodes the comparsion predicates which mutate ranges as ICmp predicate codes. This is reasonable as they're used for both instructions and constants. Thus, it belongs in the IR library with instructions and constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202838 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Move the NoFolder into the IR library as it createsChandler Carruth2014-03-04
| | | | | | instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202834 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Move ValueMap to the IR library. While this class does notChandler Carruth2014-03-04
| | | | | | | | | | | | directly care about the Value class (it is templated so that the key can be any arbitrary Value subclass), it is in fact concretely tied to the Value class through the ValueHandle's CallbackVH interface which relies on the key type being some Value subclass to establish the value handle chain. Ironically, the unittest is already in the right library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202824 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Move ValueHandle into the IR library where Value itself lives.Chandler Carruth2014-03-04
| | | | | | | | | | | Move the test for this class into the IR unittests as well. This uncovers that ValueMap too is in the IR library. Ironically, the unittest for ValueMap is useless in the Support library (honestly, so was the ValueHandle test) and so it already lives in the IR unittests. Mmmm, tasty layering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202821 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Move the LLVM IR pattern match header into the IR library, itChandler Carruth2014-03-04
| | | | | | obviously is coupled to the IR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202818 91177308-0d34-0410-b5e6-96231b3b80d8
* [Modules] Move InstIterator out of the Support library, where it had noChandler Carruth2014-03-04
| | | | | | | | | | | | | business. This header includes Function and BasicBlock and directly uses the interfaces of both classes. It has to do with the IR, it even has that in the name. =] Put it in the library it belongs to. This is one step toward making LLVM's Support library survive a C++ modules bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202814 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Re-sort all the includes with utils/sort_includes.py.Chandler Carruth2014-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202811 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleaning up a bunch of pre-Visual C++ 2012 build hacks.Yaron Keren2014-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202806 91177308-0d34-0410-b5e6-96231b3b80d8
* Give APInt move semantics.Benjamin Kramer2014-03-02
| | | | | | | The interaction between defaulted operators and move elision isn't totally obvious, add a unit test so it doesn't break unintentionally. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202662 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace LLVM_STATIC_ASSERT with static_assert, we now haveChandler Carruth2014-03-02
| | | | | | access to it on all host toolchains. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202642 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace llvm::next and llvm::prior with std::next and std::prev.Benjamin Kramer2014-03-02
| | | | | | Remove the old functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202636 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch all uses of LLVM_OVERRIDE to just use 'override' directly.Craig Topper2014-03-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202621 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Switch all uses of the llvm_move macro to use std::moveChandler Carruth2014-03-02
| | | | | | directly, and remove the macro. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202612 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add support for OwningPtr<T> to be converted to and fromChandler Carruth2014-03-02
| | | | | | | | std::unique_ptr<T>. Patch by Ahmed Charles! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202609 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add unit tests for OwningPtr<T> in preparation for changes to makeChandler Carruth2014-03-02
| | | | | | | | | | it interoperate (minimally) with std::unique_ptr<T>. This is part of my plan to migrate LLVM to use std::unique_ptr with a minimal impact on out-of-tree code. Patch by Ahmed Charles with some minor cleanups (and bool casts) by me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202608 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Remove LLVM_HAS_CXX11_STDLIB now that it is just on.Chandler Carruth2014-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202587 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Remove uses of LLVM_HAS_RVALUE_REFERENCES from the unittests.Chandler Carruth2014-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202583 91177308-0d34-0410-b5e6-96231b3b80d8
* With rpaths being set correctly, SHLIBPATH_VAR is not needed anymore.Rafael Espindola2014-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202510 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly set rpath for unittests.Rafael Espindola2014-02-28
| | | | | | | This lets us run the unittest from the command line without setting LD_LIBRARY_PATH. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202509 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the overloaded std::abs rather than C's abs(int) to address Clang's ↵David Blaikie2014-02-26
| | | | | | -Wabsolute-value git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202286 91177308-0d34-0410-b5e6-96231b3b80d8
* fix crash in SmallDenseMap copy constructorDuncan P. N. Exon Smith2014-02-25
| | | | | | | | | Prevent a crash in the SmallDenseMap copy constructor whenever the other map is not in small mode. <rdar://problem/14292693> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202206 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix resetting the DataLayout in a Module.Rafael Espindola2014-02-25
| | | | | | | | | | | | | | | No tool does this currently, but as everything else in a module we should be able to change its DataLayout. Most of the fix is in DataLayout to make sure it can be reset properly. The test uses Module::setDataLayout since the fact that we mutate a DataLayout is an implementation detail. The module could hold a OwningPtr<DataLayout> and the DataLayout itself could be immutable. Thanks to Philip Reames for pushing me in the right direction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202198 91177308-0d34-0410-b5e6-96231b3b80d8
* Make DataLayout a plain object, not a pass.Rafael Espindola2014-02-25
| | | | | | | Instead, have a DataLayoutPass that holds one. This will allow parts of LLVM don't don't handle passes to also use DataLayout. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202168 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable old JIT unittests for AARch64Renato Golin2014-02-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202127 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable an MCJIT test on older Darwins until we have a better interface.Andrew Trick2014-02-24
| | | | | | | | See <rdar://16149106> [MCJIT] provide a platform-independent way to communicate callee-save frame info. <rdar://16149279> [MCJIT] get the host OS version from a runtime check, not a configure-time check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202082 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the F_Binary flag with a F_Text one.Rafael Espindola2014-02-24
| | | | | | | | | After this I will set the default back to F_None. The advantage is that before this patch forgetting to set F_Binary would corrupt a file on windows. Forgetting to set F_Text produces one that cannot be read in notepad, which is a better failure mode :-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202052 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix windows unittest I missed in the raw_fd_ostream constructor change.Rafael Espindola2014-02-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202050 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify remove, create_directory and create_directories.Rafael Espindola2014-02-23
| | | | | | | | | | | | | | | Before this patch they would take an boolean argument to say if the path already existed. This was redundant with the returned error_code which is able to represent that. This allowed for callers to incorrectly check only the existed flag instead of first checking the error code. Instead, pass in a boolean flag to say if the previous (non-)existence should be an error or not. Callers of the of the old simple versions are not affected. They still ignore the previous (non-)existence as they did before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201979 91177308-0d34-0410-b5e6-96231b3b80d8
* Move get[S|U]LEB128Size() to LEB128.h.Logan Chien2014-02-22
| | | | | | | | | | | This commit moves getSLEB128Size() and getULEB128Size() from MCAsmInfo to LEB128.h and removes some copy-and-paste code. Besides, this commit also adds some unit tests for the LEB128 functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201937 91177308-0d34-0410-b5e6-96231b3b80d8
* This test was failing on non-X86-64 platforms because stackmaps only work on ↵Filip Pizlo2014-02-21
| | | | | | | | | | X86-64. Disable it on non-X86-64 platforms and add a comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201838 91177308-0d34-0410-b5e6-96231b3b80d8
* Stackmaps are used for OSR exits, which is a custom kind of unwinding. ↵Filip Pizlo2014-02-20
| | | | | | | | | | | | | | | | | | | Hence, they should not be marked nounwind. Marking them nounwind caused crashes in the WebKit FTL JIT, because if we enable sufficient optimizations, LLVM starts eliding compact_unwind sections (or any unwind data for that matter), making deoptimization via stackmaps impossible. This changes the stackmap intrinsic to be may-throw, adds a test for exactly the sympton that WebKit saw, and fixes TableGen to handle un-attributed intrinsics. Thanks to atrick and philipreames for reviewing this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201826 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for hashing attributes with DW_FORM_block. This requiredEric Christopher2014-02-20
| | | | | | | | | | | | | passing down an AsmPrinter instance so we could compute the size of the block which could be target specific. All of the test cases in the unittest don't have any target specific data so we can use a NULL AsmPrinter there. This also depends upon block data being added as integers. We can now hash the entire fission-cu.ll compile unit so turn the flag on there with the hash value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201752 91177308-0d34-0410-b5e6-96231b3b80d8
* This tests DW_FORM_sdata, not DW_FORM_block. Make the test say so.Eric Christopher2014-02-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201749 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix commit thinkos from splitting out patches.Eric Christopher2014-02-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201748 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for hashing DW_FORM_sdata and a small testcase.Eric Christopher2014-02-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201747 91177308-0d34-0410-b5e6-96231b3b80d8