Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / X86 / bb-with-two-tail-calls.s
blobcaad7b3d735f5f8d1ba64660f61a27231acd62ff
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 # REQUIRES: system-linux
6 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
7 # RUN: %s -o %t.o
8 # RUN: link_fdata %s %t.o %t.fdata
9 # RUN: llvm-strip --strip-unneeded %t.o
10 # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib
11 # RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata --lite=0 --dyno-stats \
12 # RUN: --print-sctc --print-only=_start 2>&1 | FileCheck %s
13 # CHECK-NOT: Assertion `BranchInfo.size() == 2 && "could only be called for blocks with 2 successors"' failed.
14 # Two tail calls in the same basic block after SCTC:
15 # CHECK: {{.*}}: ja {{.*}} # TAILCALL # CTCTakenCount: {{.*}}
16 # CHECK-NEXT: {{.*}}: jmp {{.*}} # TAILCALL
18 .globl _start
19 _start:
20 je x
21 a: ja b
22 jmp c
23 x: ret
24 # FDATA: 1 _start #a# 1 _start #b# 2 4
25 b: jmp e
26 c: jmp f
28 .globl e
30 nop
32 .globl f
34 nop