38 lines · plain
1## Tests the peephole that adds trap instructions following indirect tail calls.2 3# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown \4# RUN: %s -o %t.o5# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q6# RUN: llvm-bolt %t.exe -o %t.bolt --peepholes=tailcall-traps \7# RUN: --print-peepholes --funcs=foo,bar 2>&1 | FileCheck %s8 9# CHECK: Binary Function "foo"10# CHECK: br x0 # TAILCALL11# CHECK-NEXT: brk #0x112# CHECK: End of Function "foo"13 14# CHECK: Binary Function "bar"15# CHECK: b foo # TAILCALL16# CHECK: End of Function "bar"17 18 .text19 .align 420 .global _start21 .type _start, %function22_start:23 nop24 ret25 .size _start, .-_start26 27 .global foo28 .type foo, %function29foo:30 br x031 .size foo, .-foo32 33 .global bar34 .type bar, %function35bar:36 b foo37 .size bar, .-bar38