1 ## This reproduces a bug with dynostats when trying to compute branch stats
2 ## at a block with two tails calls (one conditional and one unconditional).
4 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
6 # RUN: link_fdata %s %t.o %t.fdata
7 # RUN: llvm-strip --strip-unneeded %t.o
8 # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
9 # RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata --lite=0 --dyno-stats \
10 # RUN: --print-sctc --print-only=_start -enable-bat 2>&1 | FileCheck %s
11 # RUN: llvm-objdump --syms %t.out > %t.log
12 # RUN: llvm-bat-dump %t.out --dump-all >> %t.log
13 # RUN: FileCheck %s --input-file %t.log --check-prefix=CHECK-BAT
15 # CHECK-NOT: Assertion `BranchInfo.size() == 2 && "could only be called for blocks with 2 successors"' failed.
16 # Two tail calls in the same basic block after SCTC:
17 # CHECK: {{.*}}: ja {{.*}} # TAILCALL # Offset: 7 # CTCTakenCount: 4
18 # CHECK-NEXT: {{.*}}: jmp {{.*}} # TAILCALL # Offset: 13
20 ## Confirm that a deleted basic block is emitted at function end offset (0xe)
21 # CHECK-BAT: [[#%x,ADDR:]] g .text [[#%x,SIZE:]] _start
22 # CHECK-BAT: Function Address: 0x[[#%x,ADDR]]
23 # CHECK-BAT: 0x[[#%x,SIZE]]
24 # CHECK-BAT: NumBlocks: 5
32 # FDATA: 1 _start #a# 1 _start #b# 2 4