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 | 1be1fe033c49e836556f3b258e1207ced61ec4e4 (patch) | |
tree | 775aa3388f6f319d8aa5da62d4597eafaa288dac /llvm/unittests/VMCore/ConstantsTest.cpp | |
parent | 426e68f793c0b89809129e1657f3dfe1f85bd21f (diff) | |
download | bcm5719-llvm-1be1fe033c49e836556f3b258e1207ced61ec4e4.tar.gz bcm5719-llvm-1be1fe033c49e836556f3b258e1207ced61ec4e4.zip |
fix PR8867: a crash handling fp128. Thanks to Nick for the testcase.
llvm-svn: 122613
Diffstat (limited to 'llvm/unittests/VMCore/ConstantsTest.cpp')
-rw-r--r-- | llvm/unittests/VMCore/ConstantsTest.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/unittests/VMCore/ConstantsTest.cpp b/llvm/unittests/VMCore/ConstantsTest.cpp index 8f28407b8de..8277584ba24 100644 --- a/llvm/unittests/VMCore/ConstantsTest.cpp +++ b/llvm/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 |