summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
* 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
* Add various coarse bit-width architecture predicates to llvm::Triple.Chandler Carruth2012-01-31
| | | | | | | These are very useful for frontends and other utilities reasoning about or selecting between triples. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149353 91177308-0d34-0410-b5e6-96231b3b80d8
* DenseMap::find_as() and unit tests.Talin2012-01-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149229 91177308-0d34-0410-b5e6-96231b3b80d8
* Additional methods for SmallString.Talin2012-01-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148881 91177308-0d34-0410-b5e6-96231b3b80d8
* unittests/Support/Casting.cpp: [PR8226] Workaround for MSVC|Debug.NAKAMURA Takumi2012-01-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148659 91177308-0d34-0410-b5e6-96231b3b80d8
* Add portable bit mask operations to BitVector.Jakob Stoklund Olesen2012-01-17
| | | | | | | | | | | | BitVector uses the native word size for its internal representation. That doesn't work well for literal bit masks in source code. This patch adds BitVector operations to efficiently apply literal bit masks specified as arrays of uint32_t. Since each array entry always holds exactly 32 bits, these portable bit masks can be source code literals, probably produced by TableGen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148272 91177308-0d34-0410-b5e6-96231b3b80d8
* MCJIT support for non-function sections.Jim Grosbach2012-01-16
| | | | | | | | | | | | | | | | Move to a by-section allocation and relocation scheme. This allows better support for sections which do not contain externally visible symbols. Flesh out the relocation address vs. local storage address separation a bit more as well. Remote process JITs use this to tell the relocation resolution code where the code will live when it executes. The startFunctionBody/endFunctionBody interfaces to the JIT and the memory manager are deprecated. They'll stick around for as long as the old JIT does, but the MCJIT doesn't use them anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148258 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
* Fix unittest makefile after r147425. This should unbreak the makefileChandler Carruth2012-01-02
| | | | | | | | | | | build. This didn't show up in the CMake build because the CMake build for the unittests is rather poorly factored. This probably isn't the correct fix. This should be a bitcode reader unittest not a VMCore unittest. I'll move it and clean various parts of the unittest up in a follow-up patch, but I wanted to unbreak the bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147427 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
* 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