diff options
author | dim <dim@FreeBSD.org> | 2011-02-20 12:57:14 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-20 12:57:14 +0000 |
commit | cbb70ce070d220642b038ea101d9c0f9fbf860d6 (patch) | |
tree | d2b61ce94e654cb01a254d2195259db5f9cc3f3c /unittests/ADT/APIntTest.cpp | |
parent | 4ace901e87dac5bbbac78ed325e75462e48e386e (diff) | |
download | FreeBSD-src-cbb70ce070d220642b038ea101d9c0f9fbf860d6.zip FreeBSD-src-cbb70ce070d220642b038ea101d9c0f9fbf860d6.tar.gz |
Vendor import of llvm trunk r126079:
http://llvm.org/svn/llvm-project/llvm/trunk@126079
Diffstat (limited to 'unittests/ADT/APIntTest.cpp')
-rw-r--r-- | unittests/ADT/APIntTest.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/unittests/ADT/APIntTest.cpp b/unittests/ADT/APIntTest.cpp index 0cb7996..557d835 100644 --- a/unittests/ADT/APIntTest.cpp +++ b/unittests/ADT/APIntTest.cpp @@ -39,6 +39,9 @@ TEST(APIntTest, i128_NegativeCount) { EXPECT_EQ(-1, Minus1.getSExtValue()); } +// XFAIL this test on FreeBSD where the system gcc-4.2.1 seems to miscompile it. +#if defined(__llvm__) || !defined(__FreeBSD__) + TEST(APIntTest, i33_Count) { APInt i33minus2(33, static_cast<uint64_t>(-2), true); EXPECT_EQ(0u, i33minus2.countLeadingZeros()); @@ -50,9 +53,11 @@ TEST(APIntTest, i33_Count) { EXPECT_EQ(((uint64_t)-2)&((1ull<<33) -1), i33minus2.getZExtValue()); } +#endif + TEST(APIntTest, i65_Count) { APInt i65minus(65, 0, true); - i65minus.set(64); + i65minus.setBit(64); EXPECT_EQ(0u, i65minus.countLeadingZeros()); EXPECT_EQ(1u, i65minus.countLeadingOnes()); EXPECT_EQ(65u, i65minus.getActiveBits()); |