[llvm] [SandboxIR] Add setOperand() and RAUW,RUWIf,RUOW (PR #98410)
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 11 13:02:24 PDT 2024
================
@@ -203,6 +206,107 @@ OperandNo: 0
EXPECT_FALSE(I0->hasNUses(0u));
EXPECT_TRUE(I0->hasNUses(1u));
EXPECT_FALSE(I0->hasNUses(2u));
+
+ // Check User.setOperand().
+ Ret->setOperand(0, Arg0);
+ EXPECT_EQ(Ret->getOperand(0), Arg0);
+ EXPECT_EQ(Ret->getOperandUse(0).get(), Arg0);
+ EXPECT_EQ(LLVMRet->getOperand(0), LLVMArg0);
+
+ Ret->setOperand(0, Arg1);
+ EXPECT_EQ(Ret->getOperand(0), Arg1);
+ EXPECT_EQ(Ret->getOperandUse(0).get(), Arg1);
+ EXPECT_EQ(LLVMRet->getOperand(0), LLVMArg1);
+}
+
+TEST_F(SandboxIRTest, RUOW) {
+ parseIR(C, R"IR(
+declare void @bar0()
+declare void @bar1()
+
+ at glob0 = global ptr @bar0
+ at glob1 = global ptr @bar1
+
+define i32 @foo(i32 %v0, i32 %v1) {
----------------
aeubanks wrote:
nit: I'd name these `%a0` or `%arg0`
https://github.com/llvm/llvm-project/pull/98410
More information about the llvm-commits
mailing list