summaryrefslogtreecommitdiff
path: root/unittests/Support
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2009-07-12 02:19:05 +0000
committerNick Lewycky <nicholas@mxc.ca>2009-07-12 02:19:05 +0000
commit2ff893f48698005f87163c8029224c718cf4cba9 (patch)
treef57a6796196fc208afbc658446ec7412277886d5 /unittests/Support
parent6db1495558913501f5083d4ba76cbee4a3daf5f2 (diff)
downloadllvm-2ff893f48698005f87163c8029224c718cf4cba9.tar.gz
llvm-2ff893f48698005f87163c8029224c718cf4cba9.tar.bz2
llvm-2ff893f48698005f87163c8029224c718cf4cba9.tar.xz
Implement ConstantRange::multiply based on the code in LoopVR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75410 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support')
-rw-r--r--unittests/Support/ConstantRangeTest.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/unittests/Support/ConstantRangeTest.cpp b/unittests/Support/ConstantRangeTest.cpp
index 83bf535028..4a9e972802 100644
--- a/unittests/Support/ConstantRangeTest.cpp
+++ b/unittests/Support/ConstantRangeTest.cpp
@@ -267,17 +267,13 @@ TEST_F(ConstantRangeTest, Multiply) {
EXPECT_EQ(Empty.multiply(One), Empty);
EXPECT_EQ(Empty.multiply(Some), Empty);
EXPECT_EQ(Empty.multiply(Wrap), Empty);
- // TODO: ConstantRange is currently over-conservative here.
- EXPECT_EQ(One.multiply(One), Full);
- // TODO: ConstantRange is currently over-conservative here.
- EXPECT_EQ(One.multiply(Some), Full);
- // TODO: ConstantRange is currently over-conservative here.
- EXPECT_EQ(One.multiply(Wrap), Full);
- // TODO: ConstantRange is currently over-conservative here.
- EXPECT_EQ(Some.multiply(Some), Full);
- // TODO: ConstantRange is currently over-conservative here.
+ EXPECT_EQ(One.multiply(One), ConstantRange(APInt(16, 0xa*0xa),
+ APInt(16, 0xa*0xa + 1)));
+ EXPECT_EQ(One.multiply(Some), ConstantRange(APInt(16, 0xa*0xa),
+ APInt(16, 0xa*0xaa9 + 1)));
+ EXPECT_TRUE(One.multiply(Wrap).isFullSet());
+ EXPECT_TRUE(Some.multiply(Some).isFullSet());
EXPECT_EQ(Some.multiply(Wrap), Full);
- // TODO: ConstantRange is currently over-conservative here.
EXPECT_EQ(Wrap.multiply(Wrap), Full);
}