Wrap ifndef NDEBUG around assertion-only code (#142227)

Otherwise we get unused variable warnings.
This commit is contained in:
Walter Lee
2025-05-30 19:48:20 -04:00
committed by GitHub
parent 339851e140
commit 1d338a0b9a

View File

@@ -437,10 +437,10 @@ define void @foo(i8 %v) {
}
!0 = !{i32 0}
)IR");
#ifndef NDEBUG
llvm::Function *LLVMF = &*M->getFunction("foo");
sandboxir::Context Ctx(C);
auto *F = Ctx.createFunction(LLVMF);
#ifndef NDEBUG
EXPECT_DEATH(sandboxir::Region::createRegionsFromMD(*F, *TTI), "No region.*");
#endif
}