[llvm-shlib] Fix the version naming style of libLLVM for Windows (#85710)
[llvm-project.git] / bolt / test / X86 / issue20.s
blob785064df89c9cd88ba0307bf46979ba1b1a8e56e
1 # This reproduces issue 20 from our github repo
2 # "BOLT crashes when removing unreachable BBs that are a target
3 # in a JT"
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 -no-pie %t.o -o %t.exe
10 # RUN: llvm-bolt %t.exe --relocs=0 --jump-tables=move --print-finalized \
11 # RUN: -o %t.out | FileCheck %s
13 # CHECK-NOT: BOLT-INFO: UCE removed {{.*}} blocks and {{.*}} bytes of code
14 # CHECK: Binary Function "main"
15 # CHECK: .LFT{{.*}} (2 instructions, align : 1)
16 # CHECK-NEXT: CFI State : 0
17 # CHECK-NEXT: 00000004: andq
18 # CHECK-NEXT: 00000008: jmpq
19 # CHECK-NEXT: Successors: .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}
22 .text
23 .globl main
24 .type main, %function
25 .size main, .Lend1-main
26 main:
27 xorq %rax, %rax
28 retq
29 andq $3, %rdi
30 jmpq *jumptbl(,%rdi,8)
32 .Lbb1:
33 movl $0x1, %eax
34 jmp .Lexit
35 .Lbb2:
36 movl $0x2, %eax
37 jmp .Lexit
38 .Lbb3:
39 movl $0x3, %eax
40 jmp .Lexit
41 .Lbb4:
42 movl $0x4, %eax
43 .Lexit:
44 retq
45 .Lend1:
47 .section .rodata
48 .globl jumptbl
49 jumptbl:
50 .quad .Lbb1
51 .quad .Lbb2
52 .quad .Lbb3
53 .quad .Lbb4