From 1d338a0b9a0d325bb10cf5181afe73cbd4077d4e Mon Sep 17 00:00:00 2001 From: Walter Lee <49250218+googlewalt@users.noreply.github.com> Date: Fri, 30 May 2025 19:48:20 -0400 Subject: [PATCH] Wrap ifndef NDEBUG around assertion-only code (#142227) 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 7d998b147e37..5d7283fa1024 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 }