58 lines · plain
1## This checks for an issue with internal calls and BAT (BOLT address2## translation). BAT needs to map every output block back to an input3## block, but passes that introduce new blocks (such as validate4## internal calls) might create new blocks without a mapping to an5## input block.6 7# REQUIRES: x86_64-linux,bolt-runtime8 9# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o10# Delete our BB symbols so BOLT doesn't mark them as entry points11# RUN: llvm-strip --strip-unneeded %t.o12# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q13 14# RUN: llvm-bolt --enable-bat %t.exe --relocs -o %t.out | FileCheck %s15# CHECK: BOLT-INFO: Wrote {{.*}} BAT maps16 17# RUN: llvm-bat-dump %t.out --dump-all | \18# RUN: FileCheck %s --check-prefix=CHECK-BAT-DUMP19# CHECK-BAT-DUMP: BAT tables for {{.*}} functions20 21 .text22 .globl main23 .type main, %function24 .p2align 425main:26 push %rbp27 mov %rsp,%rbp28 push %r1229 push %rbx30 sub $0x120,%rsp31 mov $0x3,%rbx32 movq rel(%rip), %rdi33.J1:34 cmp $0x0,%rbx35 je .J236 callq .J337 nopl (%rax,%rax,1)38 movabs $0xdeadbeef,%rax39 retq40.J2:41 add $0x120,%rsp42 pop %rbx43 pop %r1244 jmp .J445.J3:46 pop %rax47 add $0x4,%rax48 dec %rbx49 jmp .J150.J4:51 pop %rbp52 retq53end:54 .size main, .-main55 56 .data57rel: .quad end58