summaryrefslogtreecommitdiff
path: root/unittests
Commit message (Collapse)AuthorAge
...
* PR9214: Convert Metadata API to use ArrayRef.Jay Foad2011-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129932 91177308-0d34-0410-b5e6-96231b3b80d8
* Implements StringRef::compare with bounds. It is behaves similarly to ↵Lenny Maiorani2011-04-15
| | | | | | strncmp(). Unit tests also included. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129582 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't include Operator.h from InstrTypes.h.Jay Foad2011-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129271 91177308-0d34-0410-b5e6-96231b3b80d8
* While testing dragonegg I noticed that isCastable and getCastOpcodeDuncan Sands2011-04-01
| | | | | | | | | had gotten out of sync: isCastable didn't think it was possible to cast the x86_mmx type to anything, while it did think it possible to cast an i64 to x86_mmx. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128705 91177308-0d34-0410-b5e6-96231b3b80d8
* Strip trailing whitespace.Duncan Sands2011-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128622 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid turning a floating point division with a constant power of two into a ↵Benjamin Kramer2011-03-30
| | | | | | | | | denormal multiplication. Some platforms may treat denormals as zero, on other platforms multiplication with a subnormal is slower than dividing by a normal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128555 91177308-0d34-0410-b5e6-96231b3b80d8
* Add APFloat::getExactInverse.Benjamin Kramer2011-03-30
| | | | | | | | | | | | | | The idea is, that if an ieee 754 float is divided by a power of two, we can turn the division into a cheaper multiplication. This function sees if we can get an exact multiplicative inverse for a divisor and returns it if possible. This is the hard part of PR9587. I tested many inputs against llvm-gcc's frotend implementation of this optimization and didn't find any difference. However, floating point is the land of weird edge cases, so any review would be appreciated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128545 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-30
| | | | | | PHINode::Create() giving the (known or expected) number of operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128537 91177308-0d34-0410-b5e6-96231b3b80d8
* (Almost) always call reserveOperandSpace() on newly created PHINodes.Jay Foad2011-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128535 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an argument to APInt's magic udiv calculation to specify the number of ↵Benjamin Kramer2011-03-17
| | | | | | | | bits that are known zero in the divided number. This will come in handy soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127828 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes warnings emitted by Visual Studio 2010 compiler.Oscar Fuentes2011-03-01
| | | | | | Patch by Erik Olofsson! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126796 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify RecursivelyDeleteDeadPHINode. The only functionality changeDuncan Sands2011-02-21
| | | | | | | | | should be that if the phi is used by a side-effect free instruction with no uses then the phi and the instruction now get zapped (checked by the unittest). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126124 91177308-0d34-0410-b5e6-96231b3b80d8
* The signed version of our "magic number" computation for the integer ↵Cameron Zwarich2011-02-21
| | | | | | | | | | | | | approximation of a constant had a minor typo introduced when copying it from the book, which caused it to favor negative approximations over positive approximations in many cases. Positive approximations require fewer operations beyond the multiplication. In the case of division by 3, we still generate code that is a single instruction larger than GCC's code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126097 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
* Make RecursivelyDeleteDeadPHINode delete a phi node that has no users and add aNick Lewycky2011-02-20
| | | | | | | | | | test for that. With this change, test/CodeGen/X86/codegen-dce.ll no longer finds any instructions to DCE, so delete the test. Also renamed J and JP to I and IP in RecursivelyDeleteDeadPHINode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126088 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach RecursivelyDeleteDeadPHINodes to handle multiple self-references. PatchNick Lewycky2011-02-20
| | | | | | | by Andrew Clinton! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126077 91177308-0d34-0410-b5e6-96231b3b80d8
* Adds llvm::sys::path::is_separator() to test whether a char is a path separatorZhanyong Wan2011-02-11
| | | | | | | on the host OS. Reviewed by dgregor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125406 91177308-0d34-0410-b5e6-96231b3b80d8
* build: Add MAKEFILE_UNITTEST_NO_INCLUDE_COMMON build variable, to be leveragedDaniel Dunbar2011-02-04
| | | | | | by Clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124871 91177308-0d34-0410-b5e6-96231b3b80d8
* Part of this test is invariant inside the inner loop - move it outsideDuncan Sands2011-02-03
| | | | | | | the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124784 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove NoVendor and NoOS, added in commit 123990, from Triple. While itDuncan Sands2011-02-02
| | | | | | | | | | may be useful to understand "none", this is not the place for it. Tweak the fix to Normalize while there: the fix added in 123990 works correctly, but I like this way better. Finally, now that Triple understands some non-trivial environment values, teach the unittests about them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124720 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't infinitely recurse! Patch by Marius Wachtler!Chris Lattner2011-01-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124366 91177308-0d34-0410-b5e6-96231b3b80d8
* Clang was not parsing target triples involving EABI and was generating wrong ↵Renato Golin2011-01-21
| | | | | | IR (wrong PCS) and passing the wrong information down llc via the target-triple printed in IR. I've fixed this by adding the parsing of EABI into LLVM's Triple class and using it to choose the correct PCS in Clang's Tools. A Clang patch is on its way to use this infrastructure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123990 91177308-0d34-0410-b5e6-96231b3b80d8
* Unittests/Support/Path: Tweak test.Michael J. Spencer2011-01-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123546 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow unnamed_addr on declarations.Rafael Espindola2011-01-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123529 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
* Reject uses of unnamed_addr in declarations.Rafael Espindola2011-01-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123358 91177308-0d34-0410-b5e6-96231b3b80d8
* First step in fixing PR8927:Rafael Espindola2011-01-08
| | | | | | | | | | | | | | | | | | | Add a unnamed_addr bit to global variables and functions. This will be used to indicate that the address is not significant and therefore the constant or function can be merged with others. If an optimization pass can show that an address is not used, it can set this. Examples of things that can have this set by the FE are globals created to hold string literals and C++ constructors. Adding unnamed_addr to a non-const global should have no effect unless an optimization can transform that global into a constant. Aliases are not allowed to have unnamed_addr since I couldn't figure out any use for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123063 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the "ugly" method BranchInst::setUnconditionalDest().Jay Foad2011-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123026 91177308-0d34-0410-b5e6-96231b3b80d8
* UnitTests/Path: Add magical tests. This will also test identify_magic.Michael J. Spencer2011-01-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122948 91177308-0d34-0410-b5e6-96231b3b80d8
* UnitTests/Path: More ASSERT_NO_ERROR cleanup.Michael J. Spencer2011-01-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122947 91177308-0d34-0410-b5e6-96231b3b80d8
* UnitTests/Path: Fix typo, add error number, and enable the directory cleanup ↵Michael J. Spencer2011-01-05
| | | | | | code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122885 91177308-0d34-0410-b5e6-96231b3b80d8
* UnitTests/PathV2: Setup a test fixture to make tracking created file systemMichael J. Spencer2011-01-05
| | | | | | entities easier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122880 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/PathV2: Implement directory iteration on POSIX.Michael J. Spencer2011-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122879 91177308-0d34-0410-b5e6-96231b3b80d8
* UnitTests/Path: Produce useful diagnostics on error.Michael J. Spencer2011-01-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122812 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR8867: a crash handling fp128. Thanks to Nick for the testcase.Chris Lattner2010-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122613 91177308-0d34-0410-b5e6-96231b3b80d8
* Change all self assignments X=X to (void)X, so that we can turn on aJeffrey Yasskin2010-12-23
| | | | | | | | | new gcc warning that complains on self-assignments and self-initializations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122458 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
* Add more checks to IntervalMapOverlaps::advance() to ensure that advanceTo seesJakob Stoklund Olesen2010-12-17
| | | | | | monotonic keys. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122093 91177308-0d34-0410-b5e6-96231b3b80d8
* It is allowed to call IntervalMap::const_iterator::advanceTo() with a key thatJakob Stoklund Olesen2010-12-17
| | | | | | | | moves the iterator to end(), and it is valid to call it on end(). That means it is valid to call advanceTo() with any monotonic key sequence. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122092 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash when IntervalMapOverlaps::advanceTo moves past the last overlap.Jakob Stoklund Olesen2010-12-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122081 91177308-0d34-0410-b5e6-96231b3b80d8
* Complete tests for IntervalMapOverlaps.Jakob Stoklund Olesen2010-12-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122019 91177308-0d34-0410-b5e6-96231b3b80d8
* Add basic test exposing many bugs.Jakob Stoklund Olesen2010-12-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121995 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/PathV2: Change most functions in the path namespace to return their workMichael J. Spencer2010-12-07
| | | | | | via their return value instead of an out parameter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121149 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
* PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad2010-12-07
| | | | | | | | zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121120 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
* Support/PathV2: Remove the error_code return type from all functions in the pathMichael J. Spencer2010-12-07
| | | | | | | namespace. None of them return anything except for success anyway. These will be converted to returning their result soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121109 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/PathV2: Move make_absolute from path to fs.Michael J. Spencer2010-12-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121108 91177308-0d34-0410-b5e6-96231b3b80d8
* Support/FileSystem: Add directory_iterator implementation.Michael J. Spencer2010-12-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120989 91177308-0d34-0410-b5e6-96231b3b80d8
* Unittests/Support/PathV2: Add FileSystem tests.Michael J. Spencer2010-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120888 91177308-0d34-0410-b5e6-96231b3b80d8