Skip to content

Commit 267c93a

Browse files
committed
[BOLT] Add unittest for inliner using retaasppc <label>
1 parent d0943f1 commit 267c93a

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

bolt/test/AArch64/inline-pauth-lr.s

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1-
# This test checks that inlining functions with fused pointer-auth-and-return
2-
# instructions is properly handled by BOLT.
1+
# This test checks that inlining functions with the pauth-lr variants of
2+
# fused pointer-auth-and-return instructions is properly handled by BOLT.
33

44
# REQUIRES: system-linux
55

66
# RUN: %clang %cflags -march=armv9.5-a+pauth-lr -O0 %s -o %t.exe -Wl,-q
77
# RUN: llvm-bolt --inline-all --print-inline --print-only=_Z3barP1A \
88
# RUN: %t.exe -o %t.bolt | FileCheck %s
99

10-
# CHECK: BOLT-INFO: inlined 0 calls at 1 call sites in 2 iteration(s). Change in binary size: 8 bytes.
10+
# CHECK: BOLT-INFO: inlined 0 calls at 2 call sites in 2 iteration(s). Change in binary size: 16 bytes.
1111
# CHECK: Binary Function "_Z3barP1A" after inlining {
1212
# CHECK-NOT: bl _Z3fooP1A
1313
# CHECK: paciasppc
1414
# CHECK-NEXT: ldr x8, [x0]
1515
# CHECK-NEXT: ldr w0, [x8]
1616
# CHECK-NEXT: autiasppcr x28
17+
# CHECK-NEXT: paciasppc
18+
# CHECK-NEXT: ldr x7, [x0]
19+
# CHECK-NEXT: ldr w0, [x7]
20+
# CHECK-NEXT: autiasppc _Z3bazP1A
1721

1822
.text
1923
.globl _Z3fooP1A
@@ -25,12 +29,24 @@ _Z3fooP1A:
2529
retaasppcr x28
2630
.size _Z3fooP1A, .-_Z3fooP1A
2731

32+
.text
33+
.globl _Z3bazP1A
34+
.type _Z3bazP1A,@function
35+
_Z3bazP1A:
36+
0:
37+
paciasppc
38+
ldr x7, [x0]
39+
ldr w0, [x7]
40+
retaasppc 0b
41+
.size _Z3bazP1A, .-_Z3bazP1A
42+
2843
.globl _Z3barP1A
2944
.type _Z3barP1A,@function
3045
_Z3barP1A:
3146
stp x29, x30, [sp, #-16]!
3247
mov x29, sp
3348
bl _Z3fooP1A
49+
bl _Z3bazP1A
3450
mul w0, w0, w0
3551
ldp x29, x30, [sp], #16
3652
ret

0 commit comments

Comments
 (0)