Skip to content

Commit 55c76ea

Browse files
authored
[BOLT] pacret-scanner: fix regression tests... (#128565)
by making the regex to match basic block names more general. See failing test case that was reported on some system in comment #122304 (comment) These test cases were introduced in PR #122304, commit 850b492 .
1 parent cec3507 commit 55c76ea

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

bolt/test/binary-analysis/AArch64/gs-pacret-autiasp.s

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ f1:
1313
add x0, x0, #3
1414
ldp x29, x30, [sp], #16
1515
// autiasp
16-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f1, basic block .LBB{{[0-9]+}}, at address
16+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f1, basic block {{[0-9a-zA-Z.]+}}, at address
1717
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
1818
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
1919
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -66,7 +66,7 @@ f_intermediate_overwrite2:
6666
ldp x29, x30, [sp], #16
6767
autiasp
6868
mov x30, x0
69-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite2, basic block .LBB{{[0-9]+}}, at address
69+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite2, basic block {{[0-9a-zA-Z.]+}}, at address
7070
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
7171
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
7272
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov x30, x0
@@ -109,7 +109,7 @@ f_intermediate_overwrite3:
109109
ldp x29, x30, [sp], #16
110110
autiasp
111111
mov w30, w0
112-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite3, basic block .LBB{{[0-9]+}}, at address
112+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite3, basic block {{[0-9a-zA-Z.]+}}, at address
113113
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
114114
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
115115
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov w30, w0
@@ -137,7 +137,7 @@ f_nonx30_ret:
137137
ldp x29, x30, [sp], #16
138138
mov x16, x30
139139
autiasp
140-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_nonx30_ret, basic block .LBB{{[0-9]+}}, at address
140+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_nonx30_ret, basic block {{[0-9a-zA-Z.]+}}, at address
141141
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret x16
142142
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
143143
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov x16, x30
@@ -222,7 +222,7 @@ f_nonx30_ret_non_auted:
222222
.type f_callclobbered_x30,@function
223223
f_callclobbered_x30:
224224
bl g
225-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_x30, basic block .LBB{{[0-9]+}}, at address
225+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_x30, basic block {{[0-9a-zA-Z.]+}}, at address
226226
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
227227
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
228228
// CHECK-NEXT: 1. {{[0-9a-f]+}}: bl g@PLT
@@ -236,7 +236,7 @@ f_callclobbered_x30:
236236
.type f_callclobbered_calleesaved,@function
237237
f_callclobbered_calleesaved:
238238
bl g
239-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_calleesaved, basic block .LBB{{[0-9]+}}, at address
239+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_calleesaved, basic block {{[0-9a-zA-Z.]+}}, at address
240240
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret x19
241241
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
242242
// CHECK-NEXT: 1. {{[0-9a-f]+}}: bl g@PLT
@@ -325,7 +325,7 @@ f_autia1716:
325325
add x0, x0, #3
326326
ldp x29, x30, [sp], #16
327327
autia1716
328-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autia1716, basic block .LBB{{[0-9]+}}, at address
328+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autia1716, basic block {{[0-9a-zA-Z.]+}}, at address
329329
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
330330
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
331331
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -351,7 +351,7 @@ f_autib1716:
351351
add x0, x0, #3
352352
ldp x29, x30, [sp], #16
353353
autib1716
354-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autib1716, basic block .LBB{{[0-9]+}}, at address
354+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autib1716, basic block {{[0-9a-zA-Z.]+}}, at address
355355
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
356356
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
357357
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -377,7 +377,7 @@ f_autiax12:
377377
add x0, x0, #3
378378
ldp x29, x30, [sp], #16
379379
autia x12, sp
380-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autiax12, basic block .LBB{{[0-9]+}}, at address
380+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autiax12, basic block {{[0-9a-zA-Z.]+}}, at address
381381
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
382382
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
383383
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -403,7 +403,7 @@ f_autibx12:
403403
add x0, x0, #3
404404
ldp x29, x30, [sp], #16
405405
autib x12, sp
406-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autibx12, basic block .LBB{{[0-9]+}}, at address
406+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autibx12, basic block {{[0-9a-zA-Z.]+}}, at address
407407
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
408408
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
409409
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -458,7 +458,7 @@ f_autdax12:
458458
add x0, x0, #3
459459
ldp x29, x30, [sp], #16
460460
autda x12, sp
461-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdax12, basic block .LBB{{[0-9]+}}, at address
461+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdax12, basic block {{[0-9a-zA-Z.]+}}, at address
462462
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
463463
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
464464
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -484,7 +484,7 @@ f_autdbx12:
484484
add x0, x0, #3
485485
ldp x29, x30, [sp], #16
486486
autdb x12, sp
487-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdbx12, basic block .LBB{{[0-9]+}}, at address
487+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdbx12, basic block {{[0-9a-zA-Z.]+}}, at address
488488
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
489489
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
490490
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -539,7 +539,7 @@ f_autizax12:
539539
add x0, x0, #3
540540
ldp x29, x30, [sp], #16
541541
autiza x12
542-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autizax12, basic block .LBB{{[0-9]+}}, at address
542+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autizax12, basic block {{[0-9a-zA-Z.]+}}, at address
543543
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
544544
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
545545
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -565,7 +565,7 @@ f_autizbx12:
565565
add x0, x0, #3
566566
ldp x29, x30, [sp], #16
567567
autizb x12
568-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autizbx12, basic block .LBB{{[0-9]+}}, at address
568+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autizbx12, basic block {{[0-9a-zA-Z.]+}}, at address
569569
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
570570
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
571571
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -620,7 +620,7 @@ f_autdzax12:
620620
add x0, x0, #3
621621
ldp x29, x30, [sp], #16
622622
autdza x12
623-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdzax12, basic block .LBB{{[0-9]+}}, at address
623+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdzax12, basic block {{[0-9a-zA-Z.]+}}, at address
624624
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
625625
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
626626
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -646,7 +646,7 @@ f_autdzbx12:
646646
add x0, x0, #3
647647
ldp x29, x30, [sp], #16
648648
autdzb x12
649-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdzbx12, basic block .LBB{{[0-9]+}}, at address
649+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autdzbx12, basic block {{[0-9a-zA-Z.]+}}, at address
650650
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
651651
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
652652
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -725,7 +725,7 @@ f_eretaa:
725725
bl g
726726
add x0, x0, #3
727727
ldp x29, x30, [sp], #16
728-
// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eretaa, basic block .LBB{{[0-9]+}}, at address
728+
// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eretaa, basic block {{[0-9a-zA-Z.]+}}, at address
729729
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: eretaa
730730
eretaa
731731
.size f_eretaa, .-f_eretaa
@@ -739,7 +739,7 @@ f_eretab:
739739
bl g
740740
add x0, x0, #3
741741
ldp x29, x30, [sp], #16
742-
// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eretab, basic block .LBB{{[0-9]+}}, at address
742+
// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eretab, basic block {{[0-9a-zA-Z.]+}}, at address
743743
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: eretab
744744
eretab
745745
.size f_eretab, .-f_eretab
@@ -753,15 +753,15 @@ f_eret:
753753
bl g
754754
add x0, x0, #3
755755
ldp x29, x30, [sp], #16
756-
// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eret, basic block .LBB{{[0-9]+}}, at address
756+
// CHECK-LABEL: GS-PACRET: Warning: pac-ret analysis could not analyze this return instruction in function f_eret, basic block {{[0-9a-zA-Z.]+}}, at address
757757
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: eret
758758
eret
759759
.size f_eret, .-f_eret
760760

761761
.globl f_movx30reg
762762
.type f_movx30reg,@function
763763
f_movx30reg:
764-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_movx30reg, basic block .LBB{{[0-9]+}}, at address
764+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_movx30reg, basic block {{[0-9a-zA-Z.]+}}, at address
765765
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
766766
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
767767
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov x30, x22
@@ -908,7 +908,7 @@ f_autia171615:
908908
add x0, x0, #3
909909
ldp x29, x30, [sp], #16
910910
autia171615
911-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autia171615, basic block .LBB{{[0-9]+}}, at address
911+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autia171615, basic block {{[0-9a-zA-Z.]+}}, at address
912912
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
913913
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
914914
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -934,7 +934,7 @@ f_autib171615:
934934
add x0, x0, #3
935935
ldp x29, x30, [sp], #16
936936
autib171615
937-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autib171615, basic block .LBB{{[0-9]+}}, at address
937+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_autib171615, basic block {{[0-9a-zA-Z.]+}}, at address
938938
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
939939
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
940940
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10

bolt/test/binary-analysis/AArch64/gs-pacret-multi-bb.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ f_crossbb1:
1515
1:
1616
ret
1717
.size f_crossbb1, .-f_crossbb1
18-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_crossbb1, basic block .L{{[^,]+}}, at address
18+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_crossbb1, basic block {{[^,]+}}, at address
1919
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
2020
// CHECK-NEXT: The 2 instructions that write to the return register after any authentication are:
2121
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -37,7 +37,7 @@ f_mergebb1:
3737
1:
3838
ret
3939
.size f_mergebb1, .-f_mergebb1
40-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_mergebb1, basic block .L{{[^,]+}}, at address
40+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_mergebb1, basic block {{[^,]+}}, at address
4141
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
4242
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
4343
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10

0 commit comments

Comments
 (0)