1 # This reproduces an issue where two fragments of same function access same
2 # jump table, which means at least one fragment visits the other, i.e., one
3 # of them has split jump table. As a result, all of them will be marked as
6 # REQUIRES: system-linux
8 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
9 # RUN: llvm-strip --strip-unneeded %t.o
10 # RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
11 # RUN: llvm-bolt -print-cfg -v=3 %t.exe -o %t.out 2>&1 | FileCheck %s
13 # CHECK: BOLT-INFO: Multiple fragments access same jump table: main; main.cold.1
14 # CHECK: PIC Jump table JUMP_TABLE1 for function main, main.cold.1 at {{.*}} with a total count of 0:
27 # jump table dispatch, jumping to label indexed by val in %ecx
29 leaq JUMP_TABLE1
(%rip
), %r8
31 movslq
(%r8,%rcx
,4), %rax
42 # cold fragment is only reachable
44 .type main.cold.1, %function
47 # load bearing nop: pad LBB8 so that it can't be treated
48 # as __builtin_unreachable by analyzeJumpTable
56 # jump table dispatch, jumping to label indexed by val in %ecx
58 leaq JUMP_TABLE1
(%rip
), %r8
60 movslq
(%r8,%rcx
,4), %rax
71 .size main.cold.1, .-main.cold.1
74 # jmp table, entries must be R_X86_64_PC32 relocs
77 .long LBB2-JUMP_TABLE1
78 .long LBB3-JUMP_TABLE1
79 .long LBB8-JUMP_TABLE1
80 .long LBB6-JUMP_TABLE1
81 .long LBB7-JUMP_TABLE1