xref: /llvm-project/bolt/test/X86/jump-table-move.s (revision 05523dc32d8ca81d9a92ff955194a9e80cf79dc0)
1# REQUIRES: system-linux
2
3# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
4# RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q
5# RUN: llvm-bolt %t.exe -o %t.out --lite=0 -v=1 --jump-tables=move 2>&1 | FileCheck %s
6
7# CHECK-NOT: unclaimed PC-relative relocations left in data
8# CHECK: BOLT-INFO: marking main.cold.1 as a fragment of main
9# CHECK: BOLT-WARNING: Ignoring main.cold.1
10# CHECK: BOLT-WARNING: Ignoring main
11
12  .text
13  .globl main
14  .type main, %function
15  .p2align 2
16main:
17    cmpl  $0x67, %edi
18    jne main.cold.1
19LBB0:
20    retq
21.size main, .-main
22
23  .globl main.cold.1
24  .type main.cold.1, %function
25  .p2align 2
26main.cold.1:
27    jmpq  *JUMP_TABLE(,%rcx,8)
28.size main.cold.1, .-main.cold.1
29
30  .rodata
31  .globl JUMP_TABLE
32JUMP_TABLE:
33  .quad LBB0
34  .quad LBB0
35