[llvm] [SandboxIR] Added new StoreInst::create() functions with isVolatile arg (PR #100961)
Julius Alexandre via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 29 12:43:46 PDT 2024
================
@@ -810,10 +815,45 @@ define void @foo(i8 %val, ptr %ptr) {
sandboxir::StoreInst *NewSt =
sandboxir::StoreInst::create(Val, Ptr, Align(8),
/*InsertBefore=*/Ret, Ctx);
+ // Check if create was volatile
+ EXPECT_FALSE(NewSt->isVolatile());
EXPECT_EQ(NewSt->getType(), St->getType());
EXPECT_EQ(NewSt->getValueOperand(), Val);
EXPECT_EQ(NewSt->getPointerOperand(), Ptr);
EXPECT_EQ(NewSt->getAlign(), 8);
+ // Check create(InsertBefore, IsVolatile=true)
+ sandboxir::StoreInst *NewVSt =
+ sandboxir::StoreInst::create(Val, Ptr, Align(8),
+ /*InsertBefore=*/Ret,
+ /*IsVolatile=*/true, Ctx);
+ // Check if create was volatile
+ EXPECT_TRUE(NewVSt->isVolatile());
+
----------------
medievalghoul wrote:
I made sure to add those.
https://github.com/llvm/llvm-project/pull/100961
More information about the llvm-commits
mailing list