diff options
author | Chris Lattner <sabre@nondot.org> | 2010-12-29 01:33:36 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-12-29 01:33:36 +0000 |
commit | e562dba845265b5577699eb857fead1ea0f7905b (patch) | |
tree | 36e175f00fec410dfece6c6150501f117d11a829 /unittests | |
parent | b4601bd2ffdde372f1323f6b6ec98acd433501ce (diff) |
fix PR8867: a crash handling fp128. Thanks to Nick for the testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122613 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/VMCore/ConstantsTest.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/unittests/VMCore/ConstantsTest.cpp b/unittests/VMCore/ConstantsTest.cpp index 8f28407b8d..8277584ba2 100644 --- a/unittests/VMCore/ConstantsTest.cpp +++ b/unittests/VMCore/ConstantsTest.cpp @@ -109,5 +109,14 @@ TEST(ConstantsTest, IntSigns) { EXPECT_EQ(0x3b, ConstantInt::get(Int8Ty, 0x13b)->getSExtValue()); } +TEST(ConstantsTest, FP128Test) { + const Type *FP128Ty = Type::getFP128Ty(getGlobalContext()); + + const IntegerType *Int128Ty = Type::getIntNTy(getGlobalContext(), 128); + Constant *Zero128 = Constant::getNullValue(Int128Ty); + Constant *X = ConstantExpr::getUIToFP(Zero128, FP128Ty); + EXPECT_TRUE(isa<ConstantFP>(X)); +} + } // end anonymous namespace } // end namespace llvm |