Skip to content

Commit 51d928f

Browse files
authored
[BOLT] Fix pacret-synchronous-unwind.cpp test (#171395)
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. The test failed when running on RHEL 9.
1 parent 4afc92e commit 51d928f

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

bolt/test/runtime/AArch64/pacret-synchronous-unwind.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,15 @@
1111
// RUN: -fno-asynchronous-unwind-tables \
1212
// RUN: %s -o %t.exe -Wl,-q
1313
// RUN: llvm-bolt %t.exe -o %t.bolt | FileCheck %s --check-prefix=CHECK
14-
//
15-
// CHECK: PointerAuthCFIAnalyzer ran on 3 functions. Ignored
16-
// CHECK-NOT: 0 functions (0.00%) because of CFI inconsistencies
17-
// CHECK-SAME: 1 functions (33.33%) because of CFI inconsistencies
18-
// CHECK-NEXT: BOLT-WARNING: PointerAuthCFIAnalyzer only supports asynchronous
19-
// CHECK-SAME: unwind tables. For C compilers, see -fasynchronous-unwind-tables.
14+
15+
// Number of functions with .cfi-negate-ra-state in the binary is
16+
// platform-dependent.
17+
// CHECK: BOLT-INFO: PointerAuthCFIAnalyzer ran on {{[0-9]+}} functions.
18+
// CHECK-SAME: Ignored {{[0-9]}} functions ({{[0-9.]+}}%) because of CFI
19+
// CHECK-SAME: inconsistencies
20+
// CHECK-NEXT: BOLT-WARNING: PointerAuthCFIAnalyzer only supports
21+
// CHECK-SAME: asynchronous unwind tables. For C compilers, see
22+
// CHECK-SAME: -fasynchronous-unwind-tables.
2023

2124
#include <cstdio>
2225
#include <stdexcept>

0 commit comments

Comments
 (0)