[llvm] [SandboxIR] Implement UnreachableInst (PR #101856)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 5 09:07:53 PDT 2024
================
@@ -2037,3 +2037,33 @@ define void @foo(i32 %arg) {
}
EXPECT_EQ(NewPHI->getNumIncomingValues(), PHI->getNumIncomingValues());
}
+
+TEST_F(SandboxIRTest, UnreachableInst) {
+ parseIR(C, R"IR(
+define void @foo() {
+ call void @llvm.donothing()
+ unreachable
+ ret void
+}
+)IR");
+ llvm::Function *LLVMF = &*M->getFunction("foo");
+ sandboxir::Context Ctx(C);
+ sandboxir::Function *F = Ctx.createFunction(LLVMF);
+ auto *BB = &*F->begin();
+ auto It = BB->begin();
+ auto *CallInst = dyn_cast<sandboxir::CallInst>(&*It++);
----------------
vporpo wrote:
Remove this
https://github.com/llvm/llvm-project/pull/101856
More information about the llvm-commits
mailing list