[llvm] [BOLT] Fix pacret-synchronous-unwind.cpp test (PR #171395)

Gergely Bálint via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 9 04:58:25 PST 2025


https://github.com/bgergely0 updated https://github.com/llvm/llvm-project/pull/171395

>From 195669a8bfc410b6a9ee60151fd234964c9df335 Mon Sep 17 00:00:00 2001
From: Gergely Balint <gergely.balint at arm.com>
Date: Tue, 9 Dec 2025 10:43:32 +0000
Subject: [PATCH 1/2] [BOLT] Fix pacret-synchronous-unwind.cpp test

The test case build a binary from C++, and checks for the number of
functions the PointerAuthCFIFixup pass runs on.
This can change based on the platform. To account for this, the patch
changes the number to a regex.
---
 bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp b/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
index 1bfeeaed3715a..168a8d20fb007 100644
--- a/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
+++ b/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
@@ -11,10 +11,11 @@
 // RUN: -fno-asynchronous-unwind-tables \
 // RUN: %s -o %t.exe -Wl,-q
 // RUN: llvm-bolt %t.exe -o %t.bolt | FileCheck %s --check-prefix=CHECK
-//
-// CHECK: PointerAuthCFIAnalyzer ran on 3 functions. Ignored
-// CHECK-NOT: 0 functions (0.00%) because of CFI inconsistencies
-// CHECK-SAME: 1 functions (33.33%) because of CFI inconsistencies
+
+// Number of functions with .cfi-negate-ra-state in the binary is
+// platform-dependent.
+// CHECK: PointerAuthCFIAnalyzer ran on {{[0-9]}} functions.
+// CHECK: Ignored 1 functions ({{[0-9.]+}}%) because of CFI inconsistencies
 // CHECK-NEXT: BOLT-WARNING: PointerAuthCFIAnalyzer only supports asynchronous
 // CHECK-SAME: unwind tables. For C compilers, see -fasynchronous-unwind-tables.
 

>From 4c1d189685c1cbc9234d1c55b4f3512984f7699c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gergely=20B=C3=A1lint?= <gergely.balint at arm.com>
Date: Tue, 9 Dec 2025 13:58:17 +0100
Subject: [PATCH 2/2] Update
 bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp

---
 bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp b/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
index 168a8d20fb007..58fd9a226468d 100644
--- a/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
+++ b/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
@@ -14,7 +14,7 @@
 
 // Number of functions with .cfi-negate-ra-state in the binary is
 // platform-dependent.
-// CHECK: PointerAuthCFIAnalyzer ran on {{[0-9]}} functions.
+// CHECK: PointerAuthCFIAnalyzer ran on {{[0-9]+}} functions.
 // CHECK: Ignored 1 functions ({{[0-9.]+}}%) because of CFI inconsistencies
 // CHECK-NEXT: BOLT-WARNING: PointerAuthCFIAnalyzer only supports asynchronous
 // CHECK-SAME: unwind tables. For C compilers, see -fasynchronous-unwind-tables.



More information about the llvm-commits mailing list