brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 78e7285 Raw
47 lines · plain
1# This test checks that inlining functions with fused pointer-auth-and-return2# instructions into a location with a tailcall is properly handled by BOLT.3# Because _Z3barP1A ends in a tailcall, we don't remove the return instruction4# from the inlined block. Therefore, we should see a retaa, and not an autiasp.5 6# REQUIRES: system-linux7 8# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown -mattr=+v8.3a %s -o %t.o9# RUN: %clang %cflags -O0 %t.o -o %t.exe -Wl,-q10# RUN: llvm-bolt --inline-all --print-inline  --print-only=_Z3barP1A  \11# RUN: %t.exe -o %t.bolt  | FileCheck %s12 13# CHECK: BOLT-INFO: inlined 0 calls at 1 call sites in 2 iteration(s). Change in binary size: 12 bytes.14# CHECK: Binary Function "_Z3barP1A" after inlining {15# CHECK-NOT: bl	_Z3fooP1A16# CHECK:      mov	x29, sp17# CHECK-NEXT: paciasp18# CHECK-NEXT: ldr	x8, [x0]19# CHECK-NEXT: ldr	w0, [x8]20# CHECK-NEXT: retaa21 22	.text23	.globl	_Z3fooP1A24	.type	_Z3fooP1A,@function25_Z3fooP1A:26    paciasp27	ldr	x8, [x0]28	ldr	w0, [x8]29	retaa30	.size	_Z3fooP1A, .-_Z3fooP1A31 32	.globl	_Z3barP1A33	.type	_Z3barP1A,@function34_Z3barP1A:35	stp	x29, x30, [sp, #-16]!36	mov	x29, sp37	b _Z3fooP1A // tailcall38	.size	_Z3barP1A, .-_Z3barP1A39 40	.globl	main41	.p2align	242	.type	main,@function43main:44	mov	w0, wzr45	ret46	.size	main, .-main47