aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Analysis/ValueTrackingTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/Analysis/ValueTrackingTest.cpp')
-rw-r--r--llvm/unittests/Analysis/ValueTrackingTest.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/unittests/Analysis/ValueTrackingTest.cpp b/llvm/unittests/Analysis/ValueTrackingTest.cpp
index e8f15f3..4eed22d 100644
--- a/llvm/unittests/Analysis/ValueTrackingTest.cpp
+++ b/llvm/unittests/Analysis/ValueTrackingTest.cpp
@@ -2254,7 +2254,7 @@ TEST_F(ComputeKnownBitsTest, ComputeKnownUSubSatZerosPreserved) {
}
TEST_F(ComputeKnownBitsTest, ComputeKnownBitsPtrToIntTrunc) {
- // ptrtoint truncates the pointer type.
+ // ptrtoint truncates the pointer type. Make sure we don't crash.
parseAssembly(
"define void @test(ptr %p) {\n"
" %A = load ptr, ptr %p\n"
@@ -2268,12 +2268,11 @@ TEST_F(ComputeKnownBitsTest, ComputeKnownBitsPtrToIntTrunc) {
AssumptionCache AC(*F);
KnownBits Known = computeKnownBits(
A, M->getDataLayout(), /* Depth */ 0, &AC, F->front().getTerminator());
- EXPECT_EQ(Known.Zero.getZExtValue(), 31u);
- EXPECT_EQ(Known.One.getZExtValue(), 0u);
+ EXPECT_TRUE(Known.isUnknown());
}
TEST_F(ComputeKnownBitsTest, ComputeKnownBitsPtrToIntZext) {
- // ptrtoint zero extends the pointer type.
+ // ptrtoint zero extends the pointer type. Make sure we don't crash.
parseAssembly(
"define void @test(ptr %p) {\n"
" %A = load ptr, ptr %p\n"
@@ -2287,8 +2286,7 @@ TEST_F(ComputeKnownBitsTest, ComputeKnownBitsPtrToIntZext) {
AssumptionCache AC(*F);
KnownBits Known = computeKnownBits(
A, M->getDataLayout(), /* Depth */ 0, &AC, F->front().getTerminator());
- EXPECT_EQ(Known.Zero.getZExtValue(), 31u);
- EXPECT_EQ(Known.One.getZExtValue(), 0u);
+ EXPECT_TRUE(Known.isUnknown());
}
TEST_F(ComputeKnownBitsTest, ComputeKnownBitsFreeze) {