summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/IR
diff options
context:
space:
mode:
authorKevin P. Neal <kevin.neal@sas.com>2019-12-17 12:30:41 -0500
committerKevin P. Neal <kevin.neal@sas.com>2019-12-17 12:32:28 -0500
commit2f40f5681d0d896e592d1b6738d1df17228c68a8 (patch)
tree5ec03e851aa5b9202edc1cedc257690786e01455 /llvm/unittests/IR
parentff6567cc7720655de9d8731fb3005d1aaccec96a (diff)
downloadbcm5719-llvm-2f40f5681d0d896e592d1b6738d1df17228c68a8.tar.gz
bcm5719-llvm-2f40f5681d0d896e592d1b6738d1df17228c68a8.zip
[FPEnv] IRBuilder support for constrained sitofp/uitofp.
Diffstat (limited to 'llvm/unittests/IR')
-rw-r--r--llvm/unittests/IR/IRBuilderTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/unittests/IR/IRBuilderTest.cpp b/llvm/unittests/IR/IRBuilderTest.cpp
index 1ea92940b88..4ceff2d69b8 100644
--- a/llvm/unittests/IR/IRBuilderTest.cpp
+++ b/llvm/unittests/IR/IRBuilderTest.cpp
@@ -222,6 +222,16 @@ TEST_F(IRBuilderTest, ConstrainedFP) {
II = cast<IntrinsicInst>(VInt);
EXPECT_EQ(II->getIntrinsicID(), Intrinsic::experimental_constrained_fptosi);
+ VDouble = Builder.CreateUIToFP(VInt, Builder.getDoubleTy());
+ ASSERT_TRUE(isa<IntrinsicInst>(VDouble));
+ II = cast<IntrinsicInst>(VDouble);
+ EXPECT_EQ(II->getIntrinsicID(), Intrinsic::experimental_constrained_uitofp);
+
+ VDouble = Builder.CreateSIToFP(VInt, Builder.getDoubleTy());
+ ASSERT_TRUE(isa<IntrinsicInst>(VDouble));
+ II = cast<IntrinsicInst>(VDouble);
+ EXPECT_EQ(II->getIntrinsicID(), Intrinsic::experimental_constrained_sitofp);
+
V = Builder.CreateFPTrunc(VDouble, Type::getFloatTy(Ctx));
ASSERT_TRUE(isa<IntrinsicInst>(V));
II = cast<IntrinsicInst>(V);
OpenPOWER on IntegriCloud