summaryrefslogtreecommitdiff
path: root/unittests/CMakeLists.txt
Commit message (Collapse)AuthorAge
* 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
* Introduce line editor library.Peter Collingbourne2014-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | This library will be used by clang-query. I can imagine LLDB becoming another client of this library, so I think LLVM is a sensible place for it to live. It wraps libedit, and adds tab completion support. The code is loosely based on the line editor bits in LLDB, with a few improvements: - Polymorphism for retrieving the list of tab completions, based on the concept pattern from the new pass manager. - Tab completion doesn't corrupt terminal output if the input covers multiple lines. Unfortunately this can only be done in a truly horrible way, as far as I can tell. But since the alternative is to implement our own line editor (which I don't think LLVM should be in the business of doing, at least for now) I think it may be acceptable. - Includes a fallback for the case where the user doesn't have libedit installed. Note that this uses C stdio, mainly because libedit also uses C stdio. Differential Revision: http://llvm-reviews.chandlerc.com/D2200 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200595 91177308-0d34-0410-b5e6-96231b3b80d8
* No point in having a "#if 0"ed unittest.Rafael Espindola2013-12-19
| | | | | | | It is also not clear what the value of the test was. The API is used from existing tools and can (and is) tested with lit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197654 91177308-0d34-0410-b5e6-96231b3b80d8
* ArchiveFileDescriptorTests: Resurrect part of r197600, but make it ↵NAKAMURA Takumi2013-12-19
| | | | | | | | invalidated, to appease buildbots. Please revert this several hours later ;) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197635 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r197600 while I sort out why it's failing on Windows.Owen Anderson2013-12-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197602 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a unit test for loading an object file via a file descriptor. Patch by ↵Owen Anderson2013-12-18
| | | | | | Pete Cooper. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197600 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix MCDataAtom never calling remap when adding data.Rafael Espindola2013-10-16
| | | | | | | | | | | | | | | | 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
* Add a hashing routine that handles hashing types. Add a test forEric Christopher2013-09-03
| | | | | | 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-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189848 91177308-0d34-0410-b5e6-96231b3b80d8
* Make BinaryRef output correctly in case of empty data.Sean Silva2013-07-09
| | | | | | | Previously, it would simply output nothing, but it should output an empty string `""`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185894 91177308-0d34-0410-b5e6-96231b3b80d8
* Create a stub for DWARF parser unittestsAlexey Samsonov2013-04-17
| | | | | | | | Moves one DWARF-specific header to include/llvm/DebugInfo from lib/. Add a short unittest for r179095. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179678 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename the VMCore unittest tree to IR. Somehow was missed when doing theChandler Carruth2013-01-07
| | | | | | library rename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171747 91177308-0d34-0410-b5e6-96231b3b80d8
* Copy clang/Driver/<Option parsing stuff> to llvm.Michael J. Spencer2012-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169344 91177308-0d34-0410-b5e6-96231b3b80d8
* Completely refactor the structuring of unittest CMake files to match theChandler Carruth2012-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makefiles, the CMake files in every other part of the LLVM tree, and sanity. This should also restore the output tree structure of all the unit tests, sorry for breaking that, and thanks for letting me know. The fundamental change is to put a CMakeLists.txt file in the unittest directory, with a single test binary produced from it. This has several advantages: - No more weird directory stripping in the unittest macro, allowing it to be used more readily in other projects. - No more directory prefixes on all the source files. - Allows correct and precise use of LLVM's per-directory dependency system. - Allows use of the checking logic for source files that have not been added to the CMake build. This uncovered a file being skipped with CMake in LLVM and one in Clang's unit tests. - Makes Specifying conditional compilation or other custom logic for JIT tests easier. It did require adding the concept of an explicit 'optional' source file to the CMake build so that the missing-file check can skip cases where the file is *supposed* to be missing. =] This is another chunk of refactoring the CMake build in order to make it usable for other clients like CompilerRT / ASan / TSan. Note that this is interdependent with a Clang CMake change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158909 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor the logic for setting up a GoogleTest unit test executable intoChandler Carruth2012-06-21
| | | | | | | a helper function in CMake. This will allow us to share all of this logic with Clang, and eventually CompilerRT. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158896 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the naming pattern in the unittests' CMake fileChandler Carruth2012-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158893 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove one of the LLVM-specific CMake hacks in favor of standard CMakeChandler Carruth2012-06-21
| | | | | | | | | | facilities. This was only used in one place in LLVM, and was used pervasively (but with different code!) in Clang. It has no advantages over the standard CMake facilities and in some cases disadvantages. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158889 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing unittest files to the cmake build.Benjamin Kramer2012-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158647 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CMake build.Benjamin Kramer2012-06-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158601 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support to the alignment support header for conjuring a characterChandler Carruth2012-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | array of a suitable size and alignment for any of a number of different types to be stored into the character array. The mechanisms for producing an explicitly aligned type are fairly complex because this operation is poorly supported on all compilers. We've spent a fairly significant amount of time experimenting with different implementations inside of Google, and the one using explicitly expanded templates has been the most robust. Credit goes to Nick Lewycky for writing the first 20 versions or so of this logic we had inside of Google. I based this on the only one to actually survive. In case anyone is worried, yes we are both explicitly re-contributing and re-licensing it for LLVM. =] Once the issues with actually specifying the alignment are finished, it turns out that most compilers don't in turn align anything the way they are instructed. Testing of this logic against both Clang and GCC indicate that the alignment constraints are largely ignored by both compilers! I've come up with and used a work-around by wrapping each alignment-hinted type directly in a struct, and using that struct to align the character array through a union. This elaborate hackery is terrifying, but I've included testing that caught a terrifying number of bugs in every other technique I've tried. All of this in order to implement a poor C++98 programmers emulation of C++11 unrestricted unions in classes such as SmallDenseMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158597 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix gtest build issue on Visual Studio 2012 RCJustin Holewinski2012-06-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158046 91177308-0d34-0410-b5e6-96231b3b80d8
* Goodbye, JSONParser...Manuel Klimek2012-04-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154930 91177308-0d34-0410-b5e6-96231b3b80d8
* Add YAML parser to Support.Michael J. Spencer2012-04-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153977 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle unreachable code in the dominates functions. This changes users whenRafael Espindola2012-03-30
| | | | | | | needed for correctness, but still doesn't clean up code that now unnecessary checks for reachability. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153755 91177308-0d34-0410-b5e6-96231b3b80d8
* Follow-up to r152620: restore JIT event listener tests to ↵Eli Bendersky2012-03-15
| | | | | | unittest/ExecutionEngine/JIT git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152780 91177308-0d34-0410-b5e6-96231b3b80d8
* Add profiling support for Intel Parallel Amplifier XE (VTune) for JITted ↵Eli Bendersky2012-03-13
| | | | | | | | | | | | | code in LLVM. Also refactor the existing OProfile profiling code to reuse the same interfaces with the VTune profiling code. In addition, unit tests for the profiling interfaces were added. This patch was prepared by Andrew Kaylor and Daniel Malea, and reviewed in the llvm-commits list by Jim Grosbach git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152620 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a Briggs and Torczon sparse set implementation.Jakob Stoklund Olesen2012-02-22
| | | | | | | | | | | For objects that can be identified by small unsigned keys, SparseSet provides constant time clear() and fast deterministic iteration. Insert, erase, and find operations are typically faster than hash tables. SparseSet is useful for keeping information about physical registers, virtual registers, or numbered basic blocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151110 91177308-0d34-0410-b5e6-96231b3b80d8
* Hashing.h - utilities for hashing various data types.Talin2012-02-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150890 91177308-0d34-0410-b5e6-96231b3b80d8
* RefCountedBaseVPTR needs the IntrusiveRefCntPtrInfo as friend,Manuel Klimek2012-01-31
| | | | | | | | | | | | | | now that this handles the release / retain calls. Adds a regression test for that bug (which is a compile-time regression) and for the last two changes to the IntrusiveRefCntPtr, especially tests for the memory leak due to copy construction of the ref-counted object and ensuring that the traits are used for release / retain calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149411 91177308-0d34-0410-b5e6-96231b3b80d8
* Undo the hack in r147427 and move this unittest to a better home. ThisChandler Carruth2012-01-02
| | | | | | | | | | | | | | | is testing the bitcode reader's functionality, not VMCore's. Add the what is a hope sufficient build system mojo to build and run a new unittest. Also clean up some of the test's naming. The goal for the file should be to unittest the Bitcode Reader, and this is just one particular test among potentially many in the future. Also, reverse my position and relegate the PR# to a comment, but stash the comment on the same line as the test name so it doesn't get lost. This makes the code more self-documenting hopefully w/o losing track of the PR number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147431 91177308-0d34-0410-b5e6-96231b3b80d8
* Materialize functions whose basic blocks are used by global variables. FixesRafael Espindola2012-01-02
| | | | | | PR11677. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147425 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds a JSON parser and a benchmark (json-bench) to catch performance ↵Manuel Klimek2011-12-16
| | | | | | regressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146735 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a generic collection of class templates to ADT for buildingChandler Carruth2011-12-16
| | | | | | | | | | | | variadic-like functions in C++98. See the comments in the header file for a more detailed description of how these work. We plan to use these extensively in the AST matching library. This code and idea were originally authored by Zhanyong Wan. I've condensed it using macros to reduce repeatition and adjusted it to fit better with LLVM's ADT. Thanks to both David Blaikie and Doug Gregor for the review! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146729 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak CMake build on Cygwin.NAKAMURA Takumi2011-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146725 91177308-0d34-0410-b5e6-96231b3b80d8
* Land the long talked about "type system rewrite" patch. ThisChris Lattner2011-07-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | patch brings numerous advantages to LLVM. One way to look at it is through diffstat: 109 files changed, 3005 insertions(+), 5906 deletions(-) Removing almost 3K lines of code is a good thing. Other advantages include: 1. Value::getType() is a simple load that can be CSE'd, not a mutating union-find operation. 2. Types a uniqued and never move once created, defining away PATypeHolder. 3. Structs can be "named" now, and their name is part of the identity that uniques them. This means that the compiler doesn't merge them structurally which makes the IR much less confusing. 4. Now that there is no way to get a cycle in a type graph without a named struct type, "upreferences" go away. 5. Type refinement is completely gone, which should make LTO much MUCH faster in some common cases with C++ code. 6. Types are now generally immutable, so we can use "Type *" instead "const Type *" everywhere. Downsides of this patch are that it removes some functions from the C API, so people using those will have to upgrade to (not yet added) new API. "LLVM 3.0" is the right time to do this. There are still some cleanups pending after this, this patch is large enough as-is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
* Add unit tests for ADT/PackedVectorArgyrios Kyrtzidis2011-06-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133075 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle gcc-compatible compilers (such as clang) the same way we handleOscar Fuentes2011-05-11
| | | | | | | | gcc. Fixes PR9886. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131181 91177308-0d34-0410-b5e6-96231b3b80d8
* Put targets on folders, if the IDE supports the feature.Oscar Fuentes2011-02-20
| | | | | | Requires CMake 2.8.3 or newer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126092 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable RTTI when building unit tests. This avoids errors at link time.Oscar Fuentes2011-01-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123377 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ADT/IntEqClasses.h as a light-weight implementation of EquivalenceClasses.h.Jakob Stoklund Olesen2010-12-21
| | | | | | | | | | This implementation already exists as ConnectedVNInfoEqClasses in LiveInterval.cpp, and it seems to be generally useful to have a light-weight way of forming equivalence classes of small integers. IntEqClasses doesn't allow enumeration of the elements in a class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122293 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Fix warning in gtest header used by unit tests.Frits van Bommel2010-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121127 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/CMakeLists.txt: Tweak unittests' layout to be identical to GNU build.NAKAMURA Takumi2010-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121117 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests: Merge SystemTests back into SupportTests.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120330 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge System into Support.Michael J. Spencer2010-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120298 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/JITTests: Don't use --export-dynamic but --export-all-symbols on ↵NAKAMURA Takumi2010-11-26
| | | | | | | | | | | | | cygming. GNU ld/PECOFF accepts but ignores them below; --version-script --export-dynamic --rpath FIXME: autoconf should be aware of them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120179 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests: Add SystemTests.Michael J. Spencer2010-11-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120101 91177308-0d34-0410-b5e6-96231b3b80d8
* Add test for PR 8111. By Frits van Bommel.Dale Johannesen2010-11-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119870 91177308-0d34-0410-b5e6-96231b3b80d8
* Add ADT/IntervalMap.Jakob Stoklund Olesen2010-11-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a sorted interval map data structure for small keys and values with automatic coalescing and bidirectional iteration over coalesced intervals. Except for coalescing intervals, it provides similar functionality to std::map. It is however much more compact for small keys and values, and hopefully faster too. The container object itself can hold the first few intervals without any allocations, then it switches to a cache conscious B+-tree representation. A recycling allocator can be shared between many containers, even between containers holding different types. The IntervalMap is initially intended to be used with SlotIndex intervals for: - Backing store for LiveIntervalUnion that is smaller and faster than std::set. - Backing store for LiveInterval with less overhead than std::vector for typical intervals and O(N log N) merging of large intervals. 99% of virtual registers need 4 entries or less and would benefit from the small object optimization. - Backing store for LiveDebugVariable which doesn't exist yet, but will track debug variables during register allocation. This is a work in progress. Missing items are: - Performance metrics. - erase(). - insert() shrinkage. - clear(). - More performance metrics. - Simplification and detemplatization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119787 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/CMakeLists.txt: [PR8225] Tweak linking JITTests on MSVC to add ↵NAKAMURA Takumi2010-11-19
| | | | | | | | JITTests.def. CMake can pass *.def to link.exe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119783 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/CMakeLists.txt: Suppress building ValueMapTest on MSVC older than ↵NAKAMURA Takumi2010-11-19
| | | | | | | | | 10(VS2010). MSVC9 and 8 cannot compile ValueMapTest.cpp due to their bug. See issue#331418 in Visual Studio. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119782 91177308-0d34-0410-b5e6-96231b3b80d8