41 lines · plain
1# This test checks that for AArch64 binaries with BTI, we do not inline blocks with indirect tailcalls.2# Same as inline-bti.s, but checks the debug output, and therefore requires assertions.3 4# REQUIRES: system-linux, assertions5 6# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o7# RUN: %clang %cflags -O0 %t.o -o %t.exe -Wl,-q -Wl,-z,force-bti8# RUN: llvm-bolt --inline-all %t.exe -o %t.bolt --debug 2>&1 | FileCheck %s9 10# For BTI, we should not inline foo.11# CHECK: BOLT-DEBUG: Skipping inlining block with tailcall in _Z3barP1A : .LBB01 to keep BTIs consistent.12# CHECK-NOT: BOLT-INFO: inlined {{[0-9]+}} calls at {{[0-9]+}} call sites in {{[0-9]+}} iteration(s). Change in binary size: {{[0-9]+}} bytes.13 14 .text15 .globl _Z3fooP1A16 .type _Z3fooP1A,@function17_Z3fooP1A:18 ldr x8, [x0]19 ldr w0, [x8]20 br x3021 .size _Z3fooP1A, .-_Z3fooP1A22 23 .globl _Z3barP1A24 .type _Z3barP1A,@function25_Z3barP1A:26 stp x29, x30, [sp, #-16]!27 mov x29, sp28 bl _Z3fooP1A29 mul w0, w0, w030 ldp x29, x30, [sp], #1631 ret32 .size _Z3barP1A, .-_Z3barP1A33 34 .globl main35 .p2align 236 .type main,@function37main:38 mov w0, wzr39 ret40 .size main, .-main41