summaryrefslogtreecommitdiff
path: root/unittests/Support
Commit message (Collapse)AuthorAge
* Provide definitions for all functions.Benjamin Kramer2012-11-10
| | | | | | | ICC refuses to compile a class in an anonymous namespace if some functions aren't defined. Fixes PR13477. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167676 91177308-0d34-0410-b5e6-96231b3b80d8
* Casting.h: Automatically handle isa<Base>(Derived).Sean Silva2012-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Additionally, all such cases are handled with no dynamic check. All `classof()` of the form class Foo { [...] static bool classof(const Bar *) { return true; } [...] } where Foo is an ancestor of Bar are no longer necessary. Don't write them! Note: The exact test is `is_base_of<Foo, Bar>`, which is non-strict, so that Foo is considered an ancestor of itself. This leads to the following rule of thumb for LLVM-style RTTI: The argument type of `classof()` should be a strict ancestor. For more information about implementing LLVM-style RTTI, see docs/HowToSetUpLLVMStyleRTTI.rst git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165765 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding MCJIT and MemoryBuffer unit testsAndrew Kaylor2012-10-04
| | | | | | Patch by Daniel Malea. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165246 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch adds memory support functions which will later be used to ↵Andrew Kaylor2012-09-19
| | | | | | implement section-specific protection handling in MCJIT. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164249 91177308-0d34-0410-b5e6-96231b3b80d8
* cmake: Fix file path.Daniel Dunbar2012-09-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163950 91177308-0d34-0410-b5e6-96231b3b80d8
* formatted_raw_ostream: Fix a serious bug in tell().Daniel Dunbar2012-09-14
| | | | | | | | | - The current_pos function is supposed to return all the written bytes, not the current position of the underlying stream. - This caused tell() to be broken whenever the underlying stream had buffered content. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163948 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix up erroneous alignas usage while making this portable to GCC 4.7David Blaikie2012-09-14
| | | | | | Review by Chandler Carruth. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163944 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't pass a null pointer to cast<> in its unit tests.Richard Smith2012-08-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162310 91177308-0d34-0410-b5e6-96231b3b80d8
* DataExtractor: Fix integer truncation issues in LEB128 extraction.Benjamin Kramer2012-08-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162201 91177308-0d34-0410-b5e6-96231b3b80d8
* Flatten the aligned-char-array utility template to be a directlyChandler Carruth2012-08-17
| | | | | | | templated union at the request of Richard Smith. This makes it substantially easier to type. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162072 91177308-0d34-0410-b5e6-96231b3b80d8
* Properly test the LLVM_USE_RVALUE_REFERENCES macro.Michael J. Spencer2012-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161979 91177308-0d34-0410-b5e6-96231b3b80d8
* [PathV2] Add mapped_file_region. Implementation for Windows and POSIX.Michael J. Spencer2012-08-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161976 91177308-0d34-0410-b5e6-96231b3b80d8
* Added test for non-static use of cl::opt (fixed in r160170)Alexander Kornienko2012-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161751 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial commit of new FileOutputBuffer support class. Nick Kledzik2012-08-01
| | | | | | | | | Since the llvm::sys::fs::map_file_pages() support function it relies on is not yet implemented on Windows, the unit tests for FileOutputBuffer are currently conditionalized to run only on unix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161099 91177308-0d34-0410-b5e6-96231b3b80d8
* Suppress stderr noise when test case runs.Nick Kledzik2012-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161085 91177308-0d34-0410-b5e6-96231b3b80d8
* make ConstantRange::zeroExtend() optimalNuno Lopes2012-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160643 91177308-0d34-0410-b5e6-96231b3b80d8
* teach ConstantRange that zero times X is always zeroNuno Lopes2012-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160317 91177308-0d34-0410-b5e6-96231b3b80d8
* make ConstantRange::getSetSize() properly compute the size of wrapped and ↵Nuno Lopes2012-07-16
| | | | | | | | full sets. Make it always return APInts with the same bitwidth for the same ConstantRange bitwidth to simply clients git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160294 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the IRBuilder unittest from Support to VMCore. This got missed inChandler Carruth2012-07-16
| | | | | | the original move of IRBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160249 91177308-0d34-0410-b5e6-96231b3b80d8
* Move llvm/Support/TypeBuilder.h -> llvm/TypeBuilder.h. This completesChandler Carruth2012-07-15
| | | | | | | | | | | | the move of *Builder classes into the Core library. No uses of this builder in Clang or DragonEgg I could find. If there is a desire to have an IR-building-support library that contains all of these builders, that can be easily added, but currently it seems likely that these add no real overhead to VMCore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160243 91177308-0d34-0410-b5e6-96231b3b80d8
* Move llvm/Support/MDBuilder.h to llvm/MDBuilder.h, to live withChandler Carruth2012-07-15
| | | | | | | | | | | IRBuilder, DIBuilder, etc. This is the proper layering as MDBuilder can't be used (or implemented) without the Core Metadata representation. Patches to Clang and Dragonegg coming up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160237 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "IntRange:" as it appears to be breaking self hosting.Eric Christopher2012-07-02
| | | | | | This reverts commit b2833d9dcba88c6f0520cad760619200adc0442c. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159618 91177308-0d34-0410-b5e6-96231b3b80d8
* IntRange:Stepan Dyatkovskiy2012-07-02
| | | | | | | | | | | | | | | | | | | | | | | | - Changed isSingleNumber method behaviour. Now this flag is calculated on demand. IntegersSubsetMapping - Optimized diff operation. - Replaced type of Items field from std::list with std::map. - Added new methods: bool isOverlapped(self &RHS) void add(self& RHS, SuccessorClass *S) void detachCase(self& NewMapping, SuccessorClass *Succ) void removeCase(SuccessorClass *Succ) SuccessorClass *findSuccessor(const IntTy& Val) const IntTy* getCaseSingleNumber(SuccessorClass *Succ) IntegersSubsetTest - DiffTest: Added checks for successors. SimplifyCFG Updated SwitchInst usage (now it is case-ragnes compatible) for - SimplifyEqualityComparisonWithOnlyPredecessor - FoldValueComparisonIntoPredecessors git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159527 91177308-0d34-0410-b5e6-96231b3b80d8
* Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.hChandler Carruth2012-06-29
| | | | | | | | | | | | | | | | | This was always part of the VMCore library out of necessity -- it deals entirely in the IR. The .cpp file in fact was already part of the VMCore library. This is just a mechanical move. I've tried to go through and re-apply the coding standard's preferred header sort, but at 40-ish files, I may have gotten some wrong. Please let me know if so. I'll be committing the corresponding updates to Clang and Polly, and Duncan has DragonEgg. Thanks to Bill and Eric for giving the green light for this bit of cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159421 91177308-0d34-0410-b5e6-96231b3b80d8
* add ConstantRange::difference (to perform set difference/relative complement)Nuno Lopes2012-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159352 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a off-by-one bug in intersectWith(), and add a bunch of testsNuno Lopes2012-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159319 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetTest: Due to compilation failure with -std=c11, replaced -1UL ↵Stepan Dyatkovskiy2012-06-26
| | | | | | with NOT_A_NUMBER constant (0xffff). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159207 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetMapping: implemented "diff" operation. Operation allows at the ↵Stepan Dyatkovskiy2012-06-26
| | | | | | | | | | | | | | | same time perform up to three operations: - LHS exclude RHS - LHS intersect RHS (LHS successors will keeped) - RHS exclude LHS The complexity is N+M, where N is size of LHS M is size of RHS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159201 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetMapping: removed exclude operation, it will replaced with more ↵Stepan Dyatkovskiy2012-06-26
| | | | | | | | | | universal "diff" operation in next commit. Changes was separated onto two commits for better readability. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159200 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/Support/Path.cpp: [Win32] Suppress FileSystemTest.FileMapping for now.NAKAMURA Takumi2012-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159099 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/Support/Path.cpp: [Win32] Suppress FileSystemTest.Permissions for now.NAKAMURA Takumi2012-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159098 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a pragma to supress an MSVC warning on some of the absurd code I'mChandler Carruth2012-06-21
| | | | | | | | using to test the alignment support library. Patch from Nikola on IRC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158912 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
* Fix inappropriate use of anonymous namespaces in unittests.Chandler Carruth2012-06-20
| | | | | | | | | | | The TEST_F macros actually declare *subclasses* of the test fixtures. Even if they didn't we don't want them to declare external functions. The entire unit test, including both the fixture class and the fixture test cases should be wrapped in the anonymous namespace. This issue was caught by the new '-Winternal-linkage-in-inline' warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158798 91177308-0d34-0410-b5e6-96231b3b80d8
* Add permissions(), map_file_pages(), and unmap_file_pages() to llvm::sys::fs ↵Nick Kledzik2012-06-20
| | | | | | and add unit test. Unix is implemented. Windows side needs to be implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158770 91177308-0d34-0410-b5e6-96231b3b80d8
* For reasons I can't fathom MSVC supports ULL but not LLU suffixes on long ↵Benjamin Kramer2012-06-17
| | | | | | long integer literals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158648 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable a particular assertion on MSVC... I'm deeply disturbed by itsChandler Carruth2012-06-17
| | | | | | implementation of the class layout for the V8 type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158640 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some somewhat exhaustive tests of sizeof properties of this horribleChandler Carruth2012-06-17
| | | | | | construct just for my sanity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158637 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax one assertion -- long double has strange alignments on lots ofChandler Carruth2012-06-16
| | | | | | | | | platforms. Also, remove one assertion on MSVC because it produces a completely preposterous result, claiming something needs 12-byte alignment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158599 91177308-0d34-0410-b5e6-96231b3b80d8
* Try to reduce the size of the array used for compile-time testing byChandler Carruth2012-06-16
| | | | | | making the bounds all '1', and chunking it a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158598 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
* Round 2 of dead private variable removal.Benjamin Kramer2012-06-06
| | | | | | | | LLVM is now -Wunused-private-field clean except for - lib/MC/MCDisassembler/Disassembler.h. Not sure why it keeps all those unaccessible fields. - gtest. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158096 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetMapping: added exclude operation, that allows to exclude ↵Stepan Dyatkovskiy2012-06-05
| | | | | | subset of integers from current mapping. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157989 91177308-0d34-0410-b5e6-96231b3b80d8
* IntegersSubsetMapping:Stepan Dyatkovskiy2012-06-05
| | | | | | | | | Changed type of Items collection: from std::vector to std::list. Also some small fixes made in IntegersSubset.h, IntegersSubsetMapping.h and IntegersSubsetTest.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157987 91177308-0d34-0410-b5e6-96231b3b80d8
* Added unittests for IntegersSubset and IntegersSubsetMapping.Stepan Dyatkovskiy2012-06-02
| | | | | | | | | | | | - Fixed IntegersSubsetGeneric copy/assignment behaviour. - Fixed IntegersSubsetGeneric::getSize/getSingleValue methods. - Fixed IntegersSubsetGeneric::verify method. Also IntegersSubset.h and IntegersSubsetMapping.h headers was fixed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157887 91177308-0d34-0410-b5e6-96231b3b80d8
* fix corner case in ConstantRange::intersectWith().Nuno Lopes2012-05-18
| | | | | | this fixes the missed optimization I was seeing in the CorrelatedValuePropagation pass git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157032 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
* Remove support for the special 'fast' value for fpmath accuracy for the moment.Duncan Sands2012-04-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154850 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to indicate relaxed floating point requirements at the IR levelDuncan Sands2012-04-16
| | | | | | | | | | through the use of 'fpmath' metadata. Currently this only provides a 'fpaccuracy' value, which may be a number in ULPs or the keyword 'fast', however the intent is that this will be extended with additional information about NaN's, infinities etc later. No optimizations have been hooked up to this so far. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154822 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the MDBuilder helper class for conveniently creating metadata.Duncan Sands2012-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154766 91177308-0d34-0410-b5e6-96231b3b80d8