aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Analysis/ValueTrackingTest.cpp
diff options
context:
space:
mode:
authorJuneyoung Lee <aqjune@gmail.com>2021-01-05 06:49:19 +0900
committerJuneyoung Lee <aqjune@gmail.com>2021-01-05 06:50:02 +0900
commitabbef2fd46d48a0d92d86f0c00fa2973f8ae2c85 (patch)
tree8a807a8b74c0414b136ffbc3035595df478a20cb /llvm/unittests/Analysis/ValueTrackingTest.cpp
parent8e293fe6ad06225d748bdb8a4414461451e33c16 (diff)
downloadllvm-abbef2fd46d48a0d92d86f0c00fa2973f8ae2c85.zip
llvm-abbef2fd46d48a0d92d86f0c00fa2973f8ae2c85.tar.gz
llvm-abbef2fd46d48a0d92d86f0c00fa2973f8ae2c85.tar.bz2
[ValueTracking] isGuaranteedNotToBePoison should return true on undef
This is a one-line fix to isGuaranteedNotToBePoison to return true if undef is given.
Diffstat (limited to 'llvm/unittests/Analysis/ValueTrackingTest.cpp')
-rw-r--r--llvm/unittests/Analysis/ValueTrackingTest.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/unittests/Analysis/ValueTrackingTest.cpp b/llvm/unittests/Analysis/ValueTrackingTest.cpp
index 009166a..0d65774 100644
--- a/llvm/unittests/Analysis/ValueTrackingTest.cpp
+++ b/llvm/unittests/Analysis/ValueTrackingTest.cpp
@@ -884,6 +884,10 @@ TEST_F(ValueTrackingTest, isGuaranteedNotToBeUndefOrPoison) {
" ret void\n"
"}\n");
EXPECT_EQ(isGuaranteedNotToBeUndefOrPoison(A), true);
+ EXPECT_EQ(isGuaranteedNotToBeUndefOrPoison(UndefValue::get(IntegerType::get(Context, 8))), false);
+ EXPECT_EQ(isGuaranteedNotToBeUndefOrPoison(PoisonValue::get(IntegerType::get(Context, 8))), false);
+ EXPECT_EQ(isGuaranteedNotToBePoison(UndefValue::get(IntegerType::get(Context, 8))), true);
+ EXPECT_EQ(isGuaranteedNotToBePoison(PoisonValue::get(IntegerType::get(Context, 8))), false);
}
TEST_F(ValueTrackingTest, isGuaranteedNotToBeUndefOrPoison_assume) {