[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 07:28:13 PST 2025
https://github.com/bgergely0 updated https://github.com/llvm/llvm-project/pull/171395
>From fdd416d0714500889ccb89afb02e353b7290bd99 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/4] [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 5dd6504d7df46e97219758e812377b57faecce85 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/4] 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.
>From 86dcae32f91efb8db85fda850f3fed031226da79 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 15:42:45 +0100
Subject: [PATCH 3/4] 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 58fd9a226468d..93b602bace459 100644
--- a/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
+++ b/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
@@ -15,7 +15,7 @@
// 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: Ignored {{[0-9]}} 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 1007280e87ba35dc413cd1bf44043d1fee580559 Mon Sep 17 00:00:00 2001
From: Gergely Balint <gergely.balint at arm.com>
Date: Tue, 9 Dec 2025 15:05:11 +0000
Subject: [PATCH 4/4] format
---
.../test/runtime/AArch64/pacret-synchronous-unwind.cpp | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp b/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
index 93b602bace459..0f5e9a38da2ba 100644
--- a/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
+++ b/bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp
@@ -14,10 +14,12 @@
// Number of functions with .cfi-negate-ra-state in the binary is
// platform-dependent.
-// CHECK: PointerAuthCFIAnalyzer ran on {{[0-9]+}} functions.
-// CHECK: Ignored {{[0-9]}} 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.
+// CHECK: BOLT-INFO: PointerAuthCFIAnalyzer ran on {{[0-9]+}} functions.
+// CHECK-SAME: Ignored {{[0-9]}} functions ({{[0-9.]+}}%) because of CFI
+// CHECK-SAME: inconsistencies
+// CHECK-NEXT: BOLT-WARNING: PointerAuthCFIAnalyzer only supports
+// CHECK-SAME: asynchronous unwind tables. For C compilers, see
+// CHECK-SAME: -fasynchronous-unwind-tables.
#include <cstdio>
#include <stdexcept>
More information about the llvm-commits
mailing list