Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / X86 / issue26.s
blob6f9bc72d6e10dcff385e6d5e920407b0b02ae2cf
1 # This reproduces issue 26 from our github repo
2 # BOLT fails with the following assertion:
3 # llvm/tools/llvm-bolt/src/BinaryFunction.cpp:2950: void llvm::bolt::BinaryFunction::postProcessBranches(): Assertion `validateCFG() && "invalid CFG"' failed.
5 # REQUIRES: system-linux
7 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
8 # RUN: %s -o %t.o
9 # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
10 # RUN: llvm-bolt %t.exe --relocs --print-cfg -o %t.out 2>&1 \
11 # RUN: | FileCheck %s
13 # CHECK-NOT: BOLT-WARNING: CFG invalid in XYZ @ .LBB0
15 # CHECK: Binary Function "XYZ"
17 # CHECK: .Ltmp{{.*}} (1 instructions, align : 1)
18 # CHECK-NEXT: Secondary Entry Point: FUNCat{{.*}}
20 .text
21 .globl XYZ
22 .type XYZ, %function
23 .size XYZ, .Lend1-XYZ
24 XYZ:
25 movl %fs:-0x350, %eax
26 cmpl %eax, %edi
27 jne .L1
29 cmp %rdx, (%rsi)
30 jne .L2
32 movq %rcx, (%rsi)
33 .L1:
34 retq
36 .L2:
37 movl $0xffffffff, %eax
38 retq
39 .Lend1:
41 .globl FUNC
42 .type FUNC, %function
43 .size FUNC, .Lend - FUNC
44 FUNC:
45 cmpq %rdi, %rsi
46 je .L1
47 retq
48 .Lend:
50 .globl main
51 .type main, %function
52 .size main, .Lend2 - main
53 main:
54 xorq %rax, %rax
55 retq
57 # For relocations against .text
58 call exit
59 .Lend2: