[llvm] aeae703 - [unittests] Change operands of Add in AsmWriterTest from Undef to Poison
Nuno Lopes via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 8 03:37:34 PDT 2022
Author: Manuel Brito
Date: 2022-09-08T11:37:09+01:00
New Revision: aeae703b4df23062d7b28c70baf8a0ff45873d98
URL: https://github.com/llvm/llvm-project/commit/aeae703b4df23062d7b28c70baf8a0ff45873d98
DIFF: https://github.com/llvm/llvm-project/commit/aeae703b4df23062d7b28c70baf8a0ff45873d98.diff
LOG: [unittests] Change operands of Add in AsmWriterTest from Undef to Poison
Replacing UndefValue with PoisonValue in this test where it's use as dummy value
in light of the efforts to remove undef from llvm.
Differential Revision: https://reviews.llvm.org/D133481
Added:
Modified:
llvm/unittests/IR/AsmWriterTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/IR/AsmWriterTest.cpp b/llvm/unittests/IR/AsmWriterTest.cpp
index 4fa1889659186..c8b5379342de3 100644
--- a/llvm/unittests/IR/AsmWriterTest.cpp
+++ b/llvm/unittests/IR/AsmWriterTest.cpp
@@ -24,14 +24,14 @@ TEST(AsmWriterTest, DebugPrintDetachedInstruction) {
// has metadata attached but no parent.
LLVMContext Ctx;
auto Ty = Type::getInt32Ty(Ctx);
- auto Undef = UndefValue::get(Ty);
- std::unique_ptr<BinaryOperator> Add(BinaryOperator::CreateAdd(Undef, Undef));
+ auto Poison = PoisonValue::get(Ty);
+ std::unique_ptr<BinaryOperator> Add(BinaryOperator::CreateAdd(Poison, Poison));
Add->setMetadata(
"", MDNode::get(Ctx, {ConstantAsMetadata::get(ConstantInt::get(Ty, 1))}));
std::string S;
raw_string_ostream OS(S);
Add->print(OS);
- std::size_t r = OS.str().find("<badref> = add i32 undef, undef, !<empty");
+ std::size_t r = OS.str().find("<badref> = add i32 poison, poison, !<empty");
EXPECT_TRUE(r != std::string::npos);
}
More information about the llvm-commits
mailing list