Skip to content

Commit 6c61c55

Browse files
authored
[BOLT] pacret-scanner: fix regression test failure (#128576)
... which is caused by a seemingly recent change in BOLTs basic block calculation, where function calls seem to be ending basic blocks? I don't have a pointer to the commit that caused this change. I'll be looking for that later. For now, I'm trying to get the regression tests passing again.
1 parent e063365 commit 6c61c55

File tree

1 file changed

+3
-77
lines changed

1 file changed

+3
-77
lines changed

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

Lines changed: 3 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ f1:
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
2020
// CHECK-NEXT: This happens in the following basic block:
21-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
22-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
23-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
24-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
2521
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
2622
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
2723
// CHECK-NEXT: {{[0-9a-f]+}}: ret
@@ -39,15 +35,11 @@ f_intermediate_overwrite1:
3935
add x0, x0, #3
4036
autiasp
4137
ldp x29, x30, [sp], #16
42-
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite1, basic block .LBB
38+
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_intermediate_overwrite1, basic block {{[0-9a-zA-Z.]+}}
4339
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
4440
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
4541
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
4642
// CHECK-NEXT: This happens in the following basic block:
47-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
48-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
49-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
50-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
5143
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
5244
// CHECK-NEXT: {{[0-9a-f]+}}: autiasp
5345
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
@@ -71,10 +63,6 @@ f_intermediate_overwrite2:
7163
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
7264
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov x30, x0
7365
// CHECK-NEXT: This happens in the following basic block:
74-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
75-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
76-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
77-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
7866
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
7967
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
8068
// CHECK-NEXT: {{[0-9a-f]+}}: autiasp
@@ -114,10 +102,6 @@ f_intermediate_overwrite3:
114102
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
115103
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov w30, w0
116104
// CHECK-NEXT: This happens in the following basic block:
117-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
118-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
119-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
120-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
121105
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
122106
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
123107
// CHECK-NEXT: {{[0-9a-f]+}}: autiasp
@@ -142,10 +126,6 @@ f_nonx30_ret:
142126
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
143127
// CHECK-NEXT: 1. {{[0-9a-f]+}}: mov x16, x30
144128
// CHECK-NEXT: This happens in the following basic block:
145-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
146-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
147-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
148-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
149129
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
150130
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
151131
// CHECK-NEXT: {{[0-9a-f]+}}: mov x16, x30
@@ -225,10 +205,7 @@ f_callclobbered_x30:
225205
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_x30, basic block {{[0-9a-zA-Z.]+}}, at address
226206
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret
227207
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
228-
// CHECK-NEXT: 1. {{[0-9a-f]+}}: bl g@PLT
229-
// CHECK-NEXT: This happens in the following basic block:
230-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
231-
// CHECK-NEXT: {{[0-9a-f]+}}: ret
208+
// CHECK-NEXT: 1. {{[0-9a-f]+}}: bl
232209
ret
233210
.size f_callclobbered_x30, .-f_callclobbered_x30
234211

@@ -239,10 +216,7 @@ f_callclobbered_calleesaved:
239216
// CHECK-LABEL: GS-PACRET: non-protected ret found in function f_callclobbered_calleesaved, basic block {{[0-9a-zA-Z.]+}}, at address
240217
// CHECK-NEXT: The return instruction is {{[0-9a-f]+}}: ret x19
241218
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
242-
// CHECK-NEXT: 1. {{[0-9a-f]+}}: bl g@PLT
243-
// CHECK-NEXT: This happens in the following basic block:
244-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
245-
// CHECK-NEXT: {{[0-9a-f]+}}: ret x19
219+
// CHECK-NEXT: 1. {{[0-9a-f]+}}: bl
246220
// x19, according to the Arm ABI (AAPCS) is a callee-saved register.
247221
// Therefore, if function g respects the AAPCS, it should not write
248222
// anything to x19. However, we can't know whether function g actually
@@ -330,10 +304,6 @@ f_autia1716:
330304
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
331305
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
332306
// CHECK-NEXT: This happens in the following basic block:
333-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
334-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
335-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
336-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
337307
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
338308
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
339309
// CHECK-NEXT: {{[0-9a-f]+}}: autia1716
@@ -356,10 +326,6 @@ f_autib1716:
356326
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
357327
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
358328
// CHECK-NEXT: This happens in the following basic block:
359-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
360-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
361-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
362-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
363329
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
364330
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
365331
// CHECK-NEXT: {{[0-9a-f]+}}: autib1716
@@ -382,10 +348,6 @@ f_autiax12:
382348
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
383349
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
384350
// CHECK-NEXT: This happens in the following basic block:
385-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
386-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
387-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
388-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
389351
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
390352
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
391353
// CHECK-NEXT: {{[0-9a-f]+}}: autia x12, sp
@@ -408,10 +370,6 @@ f_autibx12:
408370
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
409371
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
410372
// CHECK-NEXT: This happens in the following basic block:
411-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
412-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
413-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
414-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
415373
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
416374
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
417375
// CHECK-NEXT: {{[0-9a-f]+}}: autib x12, sp
@@ -463,10 +421,6 @@ f_autdax12:
463421
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
464422
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
465423
// CHECK-NEXT: This happens in the following basic block:
466-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
467-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
468-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
469-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
470424
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
471425
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
472426
// CHECK-NEXT: {{[0-9a-f]+}}: autda x12, sp
@@ -489,10 +443,6 @@ f_autdbx12:
489443
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
490444
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
491445
// CHECK-NEXT: This happens in the following basic block:
492-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
493-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
494-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
495-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
496446
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
497447
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
498448
// CHECK-NEXT: {{[0-9a-f]+}}: autdb x12, sp
@@ -544,10 +494,6 @@ f_autizax12:
544494
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
545495
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
546496
// CHECK-NEXT: This happens in the following basic block:
547-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
548-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
549-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
550-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
551497
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
552498
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
553499
// CHECK-NEXT: {{[0-9a-f]+}}: autiza x12
@@ -570,10 +516,6 @@ f_autizbx12:
570516
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
571517
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
572518
// CHECK-NEXT: This happens in the following basic block:
573-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
574-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
575-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
576-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
577519
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
578520
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
579521
// CHECK-NEXT: {{[0-9a-f]+}}: autizb x12
@@ -625,10 +567,6 @@ f_autdzax12:
625567
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
626568
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
627569
// CHECK-NEXT: This happens in the following basic block:
628-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
629-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
630-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
631-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
632570
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
633571
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
634572
// CHECK-NEXT: {{[0-9a-f]+}}: autdza x12
@@ -651,10 +589,6 @@ f_autdzbx12:
651589
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
652590
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
653591
// CHECK-NEXT: This happens in the following basic block:
654-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
655-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
656-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
657-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
658592
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
659593
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
660594
// CHECK-NEXT: {{[0-9a-f]+}}: autdzb x12
@@ -913,10 +847,6 @@ f_autia171615:
913847
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
914848
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
915849
// CHECK-NEXT: This happens in the following basic block:
916-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
917-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
918-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
919-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
920850
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
921851
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
922852
// CHECK-NEXT: {{[0-9a-f]+}}: autia171615
@@ -939,10 +869,6 @@ f_autib171615:
939869
// CHECK-NEXT: The 1 instructions that write to the return register after any authentication are:
940870
// CHECK-NEXT: 1. {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
941871
// CHECK-NEXT: This happens in the following basic block:
942-
// CHECK-NEXT: {{[0-9a-f]+}}: paciasp
943-
// CHECK-NEXT: {{[0-9a-f]+}}: stp x29, x30, [sp, #-0x10]!
944-
// CHECK-NEXT: {{[0-9a-f]+}}: mov x29, sp
945-
// CHECK-NEXT: {{[0-9a-f]+}}: bl g@PLT
946872
// CHECK-NEXT: {{[0-9a-f]+}}: add x0, x0, #0x3
947873
// CHECK-NEXT: {{[0-9a-f]+}}: ldp x29, x30, [sp], #0x10
948874
// CHECK-NEXT: {{[0-9a-f]+}}: autib171615

0 commit comments

Comments
 (0)