Skip to content

Conversation

@bgergely0
Copy link
Contributor

@bgergely0 bgergely0 commented Nov 26, 2025

The AArch64_BTI MCPlusBuilder unittest was failing in no assertion
builds. Add #ifndef NDEBUG to exclude the assertion test from
no assertion builds.

Add `#ifndef NDEBUG` to exclude the failing assertion test from
no assertion build.
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@bgergely0 bgergely0 marked this pull request as ready for review November 26, 2025 11:02
@llvmbot llvmbot added the BOLT label Nov 26, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 26, 2025

@llvm/pr-subscribers-bolt

Author: Gergely Bálint (bgergely0)

Changes

Add #ifndef NDEBUG to exclude the assertion test from a
no assertion build.


Full diff: https://github.com/llvm/llvm-project/pull/169635.diff

1 Files Affected:

  • (modified) bolt/unittests/Core/MCPlusBuilder.cpp (+2)
diff --git a/bolt/unittests/Core/MCPlusBuilder.cpp b/bolt/unittests/Core/MCPlusBuilder.cpp
index 439d72a343ce8..7f2a2100363e9 100644
--- a/bolt/unittests/Core/MCPlusBuilder.cpp
+++ b/bolt/unittests/Core/MCPlusBuilder.cpp
@@ -171,9 +171,11 @@ TEST_P(MCPlusBuilderTester, AArch64_BTI) {
   ASSERT_EQ(II->getOperand(0).getImm(), 34);
   ASSERT_TRUE(BC->MIB->isBTILandingPad(*II, true, false));
 
+#ifndef NDEBUG
   MCInst BTIinvalid;
   ASSERT_DEATH(BC->MIB->createBTI(BTIinvalid, false, false),
                "No target kinds!");
+#endif
 
   MCInst Paciasp = MCInstBuilder(AArch64::PACIASP);
   II = BB->addInstruction(Paciasp);

@bgergely0 bgergely0 merged commit de4e128 into main Nov 26, 2025
14 checks passed
@bgergely0 bgergely0 deleted the users/bgergely0/bolt-fix-assertion-test branch November 26, 2025 14:26
tanji-dg pushed a commit to tanji-dg/llvm-project that referenced this pull request Nov 27, 2025
The AArch64_BTI MCPlusBuilder unittest was failing in no assertion
builds. Add `#ifndef NDEBUG` to exclude the assertion test from
no assertion builds.
GeneraluseAI pushed a commit to GeneraluseAI/llvm-project that referenced this pull request Nov 27, 2025
The AArch64_BTI MCPlusBuilder unittest was failing in no assertion
builds. Add `#ifndef NDEBUG` to exclude the assertion test from
no assertion builds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants