[llvm] [BOLT] Gate PointerAuthCFIFixup unit test on AArch64 target availability (PR #197464)

Brian Cain via llvm-commits llvm-commits at lists.llvm.org
Wed May 13 07:50:57 PDT 2026


https://github.com/androm3da created https://github.com/llvm/llvm-project/pull/197464

The test bodies reference AArch64:: namespace identifiers (ADDSXri, X0) which fail to compile when AArch64 is not in LLVM_TARGETS_TO_BUILD. Wrap all TEST_P bodies in #ifdef AARCH64_AVAILABLE and add GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST to suppress GoogleTest's uninstantiated suite error when no target instantiates the tests.

>From 56ee39c3f1156174bb395b46fb994d3b2291bb38 Mon Sep 17 00:00:00 2001
From: Brian Cain <brian.cain at oss.qualcomm.com>
Date: Wed, 13 May 2026 07:48:17 -0700
Subject: [PATCH] [BOLT] Gate PointerAuthCFIFixup unit test on AArch64 target
 availability

The test bodies reference AArch64:: namespace identifiers (ADDSXri, X0)
which fail to compile when AArch64 is not in LLVM_TARGETS_TO_BUILD.
Wrap all TEST_P bodies in #ifdef AARCH64_AVAILABLE and add
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST to suppress GoogleTest's
uninstantiated suite error when no target instantiates the tests.
---
 bolt/unittests/Passes/PointerAuthCFIFixup.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bolt/unittests/Passes/PointerAuthCFIFixup.cpp b/bolt/unittests/Passes/PointerAuthCFIFixup.cpp
index 0d54b31724274..89896d0ce3fdc 100644
--- a/bolt/unittests/Passes/PointerAuthCFIFixup.cpp
+++ b/bolt/unittests/Passes/PointerAuthCFIFixup.cpp
@@ -122,6 +122,9 @@ struct PassTester : public testing::TestWithParam<Triple::ArchType> {
 };
 } // namespace
 
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PassTester);
+
+#ifdef AARCH64_AVAILABLE
 TEST_P(PassTester, ExampleTest) {
   if (GetParam() != Triple::aarch64)
     GTEST_SKIP();
@@ -332,6 +335,7 @@ TEST_P(PassTester, fillUnknownStubsEmpty) {
   // BB2 should be set to BF.initialRAState (false).
   EXPECT_FALSE(*RAState);
 }
+#endif // AARCH64_AVAILABLE
 
 #ifdef AARCH64_AVAILABLE
 INSTANTIATE_TEST_SUITE_P(AArch64, PassTester,



More information about the llvm-commits mailing list