summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
* Some unittests for APInt rotates; patch by Cameron McInally.Eli Friedman2011-12-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147186 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes the JSON parser to use the SourceMgr.Manuel Klimek2011-12-21
| | | | | | | | Diagnostics are now emitted via the SourceMgr and we use MemoryBuffer for buffer management. Switched the code to make use of the trailing '0' that MemoryBuffer guarantees where it makes sense. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147063 91177308-0d34-0410-b5e6-96231b3b80d8
* Unweaken vtables as per ↵David Blaikie2011-12-20
| | | | | | http://llvm.org/docs/CodingStandards.html#ll_virtual_anch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146960 91177308-0d34-0410-b5e6-96231b3b80d8
* As Doug pointed out (and I really should know), it is perfectly easy toChandler Carruth2011-12-17
| | | | | | | | | make VariadicFunction actually be trivial. Do so, and also make it look more like your standard trivial functor by making it a struct with no access specifiers. The unit test is updated to initialize its functors properly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146827 91177308-0d34-0410-b5e6-96231b3b80d8
* APInt: update asserts for base-36Dylan Noblesmith2011-12-16
| | | | | | | | Hexatridecimal was added in r139695. And fix the unittest that now triggers the assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146754 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
* Put the '*' in the right place in the unit test. Forgot to fix up thisChandler Carruth2011-12-16
| | | | | | bit of style, sorry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146733 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
* build/unittests: Fix llvm-config names for gtest libraries, and bring MakefileDaniel Dunbar2011-12-15
| | | | | | | library names in line with those used by CMake. - Patch by Johannes Obermayr, with tweaks by me. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146706 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r146363 to allow buildbots to make forward progress.Chad Rosier2011-12-12
| | | | | | | | Original commit message: Support/FileSystem: Implement canonicalize. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146378 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/FileSystem: Implement bool equivalent(file_status A, file_status B);Michael J. Spencer2011-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146364 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/FileSystem: Implement canonicalize.Michael J. Spencer2011-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146363 91177308-0d34-0410-b5e6-96231b3b80d8
* re-enable unittestDylan Noblesmith2011-12-12
| | | | | | Accidentally left out since r145214/r145217. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146356 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/Support/Path.cpp: [recursive_directory_iterator] Work around for ↵NAKAMURA Takumi2011-12-09
| | | | | | | | end iterator. FIXME: It should be more robust. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146294 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/SupportTests: Fix test. pop modifies the current entry, thus theMichael J. Spencer2011-12-09
| | | | | | dontlookhere check must be after it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146217 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/SupportTests: Add some outs()'s to debug the issues on some bots.Michael J. Spencer2011-12-09
| | | | | | | I have run these tests under many configurations on the exact same OS as the failures, and I can't reproduce them :(. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146214 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/FileSystem: Implement recursive_directory_iterator and makeMichael J. Spencer2011-12-08
| | | | | | directory_iterator preserve InputIterator semantics on copy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146200 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for vectors of pointers.Nadav Rotem2011-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145801 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests: add ErrorStr to ExecutionEngine testDylan Noblesmith2011-12-02
| | | | | | Makes failures more self-explanatory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145704 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix APFloat::convert so that it handles narrowing conversions correctly; itEli Friedman2011-11-26
| | | | | | | | | | was returning incorrect values in rare cases, and incorrectly marking exact conversions as inexact in some more common cases. Fixes PR11406, and a missed optimization in test/CodeGen/X86/fp-stack-O0.ll. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145141 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Windows build, don't try to #include <pthread.h> when we know it's notNick Lewycky2011-11-14
| | | | | | | available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144574 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for tsan annotations (thread sanitizer, a valgrind-based tool).Nick Lewycky2011-11-14
| | | | | | | | | | | | | These annotations are disabled entirely when either ENABLE_THREADS is off, or building a release build. When enabled, they add calls to functions with no statements to ManagedStatic's getters. Use these annotations to inform tsan that the race used inside ManagedStatic initialization is actually benign. Thanks to Kostya Serebryany for helping write this patch! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144567 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/MultiJITTest.cpp: Tweak how to check symbol value for Win32 ↵NAKAMURA Takumi2011-11-09
| | | | | | | | | --enable-shared. getPointerToNamedFunction might be indirect jump on Win32 --enable-shared. FF 25 <disp32>: jmp *(pointer to IAT) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144178 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement comparison operators for BranchProbability in a way that can't ↵Benjamin Kramer2011-10-24
| | | | | | | | overflow INT64_MAX. Add a test case for the edge case that triggers this. Thanks to Chandler for bringing this to my attention. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142794 91177308-0d34-0410-b5e6-96231b3b80d8
* Add compare operators to BranchProbability and use it to determine if an ↵Benjamin Kramer2011-10-23
| | | | | | edge is hot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142751 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance llvm::SourceMgr to support diagnostic ranges, the same way clang ↵Chris Lattner2011-10-16
| | | | | | | | | | | | | | | | | does. Enhance the X86 asmparser to produce ranges in the one case that was annoying me, for example: test.s:10:15: error: invalid operand for instruction movl 0(%rax), 0(%edx) ^~~~~~~ It should be straight-forward to enhance filecheck, tblgen, and/or the .ll parser to use ranges where appropriate if someone is interested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142106 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a bad char heuristic to StringRef::find.Benjamin Kramer2011-10-15
| | | | | | | | | Based on Horspool's simplified version of Boyer-Moore. We use a constant-sized table of uint8_ts to keep cache thrashing low, needles bigger than 255 bytes are uncommon anyways. The worst case is still O(n*m) but we do a lot better on the average case now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142061 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to fix MSVC build.Eli Friedman2011-10-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141831 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix APFloat::getLargest so that it actually returns the correct value. ↵Eli Friedman2011-10-12
| | | | | | Found by accident while reviewing a patch to nearby code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141816 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix APInt::operator*= so that it computes the correct result for large ↵Eli Friedman2011-10-07
| | | | | | integers where there is unsigned overflow. Fix APFloat::toString so that it doesn't depend on the incorrect behavior in common cases (and computes the correct result in some rare cases). Fixes PR11086. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141441 91177308-0d34-0410-b5e6-96231b3b80d8
* The product of two chrec's can always be represented as a chrec.Nick Lewycky2011-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141066 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in compare_numeric().Jakob Stoklund Olesen2011-09-30
| | | | | | Thanks to Alexandru Dura and Jonas Paulsson for finding it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140859 91177308-0d34-0410-b5e6-96231b3b80d8
* NULL cannot be portably used as the last argument to a function with ↵Eli Friedman2011-09-28
| | | | | | __attribute((sentinel)), even though it usually works. Use (void*)0 instead. PR11002. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140720 91177308-0d34-0410-b5e6-96231b3b80d8
* Add APInt support for converting to/from hexatridecimal stringsDouglas Gregor2011-09-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139695 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/Support/DataExtractorTest.cpp: Specify ULL explicitly to a few ↵NAKAMURA Takumi2011-09-13
| | | | | | | | constants. It seems i686-cygwin-gcc-4.3 does not accept 64-bit constant without LL. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139664 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the DataExtractor utility class.Benjamin Kramer2011-09-13
| | | | | | | | | | It is an endian-aware helper that can read data from a StringRef. It will come in handy for DWARF parsing. This class is inspired by LLDB's DataExtractor, but is stripped down to the bare minimum needed for DWARF. Comes with unit tests! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139626 91177308-0d34-0410-b5e6-96231b3b80d8
* Exclude more arm jit failures pending PR10783.Andrew Trick2011-09-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139074 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix C++0x narrowing errors when char is unsigned.Jeffrey Yasskin2011-08-30
| | | | | | | In the case of EDInstInfo, this would actually cause a bug when -1 became 255 and was then compared >=0 in llvm-mc/Disassembler.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138825 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a test that wasn't testing the right thing.Matt Beaumont-Gay2011-08-29
| | | | | | | | The APFloat "Zero" test was actually calling the APFloat(const fltSemantics &, integerPart) constructor, and EXPECT_EQ was treating 0 and -0 as equal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138745 91177308-0d34-0410-b5e6-96231b3b80d8
* The 'expected' argument to EXPECT_EQ is actually the first one;John McCall2011-08-27
| | | | | | | | flip these tests around. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138708 91177308-0d34-0410-b5e6-96231b3b80d8
* Excluding ARM JIT tests until someone can fix this compilation path.Andrew Trick2011-08-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138676 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TargetRegistry and TargetSelect from Target to Support where they belong.Evan Cheng2011-08-24
| | | | | | | These are strictly utilities for registering targets and components. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138450 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid undefined behaviour if somehow NUM_GRAPHS equals 2^32 (orDuncan Sands2011-07-29
| | | | | | | | whatever the size of unsigned is), though this can't actually occur for any integer value of NUM_NODES. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136460 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove extra semicolon.Jakub Staszak2011-07-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136432 91177308-0d34-0410-b5e6-96231b3b80d8
* Use unsigned rather than uint16_t in case anyone feels like testingDuncan Sands2011-07-28
| | | | | | | | | | more graphs, like all graphs with 5 nodes or less. With a 32 bit unsigned type, the maximum is graphs with 6 nodes or less, but that would take a while to test - 5 nodes or less already requires a few seconds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136354 91177308-0d34-0410-b5e6-96231b3b80d8
* Check an additional property specific to the way LLVMDuncan Sands2011-07-28
| | | | | | | iterates over SCC's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136353 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a unittest for the simply connected components (SCC) iterator class.Duncan Sands2011-07-28
| | | | | | | | | This computes every graph with 4 or fewer nodes, and checks that the SCC class indeed returns exactly the simply connected components reachable from the initial node. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136351 91177308-0d34-0410-b5e6-96231b3b80d8
* Add test cases for BlockFrequency.Jakub Staszak2011-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136244 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove some code that is no longer needed now that googletest knows howJay Foad2011-07-27
| | | | | | to print STL containers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136213 91177308-0d34-0410-b5e6-96231b3b80d8