From c965709fb06971a0679a81863d2df9ddb467ec05 Mon Sep 17 00:00:00 2001 From: Walter Lee Date: Fri, 30 May 2025 22:33:10 +0000 Subject: [PATCH] Wrap ifndef NDEBUG around assertion-only code Otherwise we get unused variable warnings. --- llvm/unittests/SandboxIR/RegionTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/unittests/SandboxIR/RegionTest.cpp b/llvm/unittests/SandboxIR/RegionTest.cpp index 7d998b147e37c..5d7283fa1024f 100644 --- a/llvm/unittests/SandboxIR/RegionTest.cpp +++ b/llvm/unittests/SandboxIR/RegionTest.cpp @@ -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 }