Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / X86 / tail-duplication-jt.s
blob03211b399ba676a7a5ea438135fb5c6aae941c52
1 # This reproduces a bug in tail duplication when aggressiveCodeToDuplicate
2 # fails to handle a block with a jump table.
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: %clangxx %cflags -no-pie %t.o -o %t.exe -Wl,-q
11 # RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata --relocs \
12 # RUN: --tail-duplication=aggressive \
13 # RUN: --print-cfg | FileCheck %s
14 # CHECK: Jump table {{.*}} for function a at {{.*}} with a total count of 3
15 .globl main
16 main:
17 .globl a
18 .type a, %function
20 .cfi_startproc
22 jmp c
23 je b
24 movl %esi, %edi
26 movb 0, %cl
28 jmp e
29 movq 0, %r14
31 je d
32 jmp f
36 movq %rbp, 0
38 cmpl $0x41, 0
40 jmp h
41 jmp i
42 ja o
43 movl %edx, 0
47 jmpq *JT0(,%rcx,8)
48 # FDATA: 1 a #k# 1 a #l# 1 3
50 movl 0, %esi
52 jmpq *JT1(,%rax,8)
53 cmpl 1, %eax
54 jmp j
56 jmp m
58 movl 6, %ebx
59 ak:
60 jmp e
61 movl 0, %eax
62 am:
63 jmp p
64 jmp q
66 jmp g
68 xorl %r12d, %r12d
69 .cfi_endproc
70 .rodata
71 JT0:
72 .quad r
73 .quad l
74 .quad ak
75 JT1:
76 .quad s
77 .quad am
78 .quad n