1 # This checks that we don't create an invalid CFG when there is an
2 # unreachable direct jump right after an indirect one.
4 # REQUIRES: system-linux
6 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
8 # RUN: link_fdata %s %t.o %t.fdata
9 # RUN: llvm-strip --strip-unneeded %t.o
10 # RUN: %clang %cflags -no-pie %t.o -o %t.exe -Wl,-q -nostdlib
11 # RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata \
12 # RUN: --eliminate-unreachable --print-cfg | FileCheck %s
15 .type _start, %function
18 # FDATA: 0 [unknown] 0 1 _start 0 0 1
26 jmpq
*JUMP_TABLE
(,%rcx
,8)
27 # FDATA: 1 _start #b# 1 _start #hotpath# 0 20
28 # Unreachable direct jump here. Our CFG should still make sense and properly
29 # place this instruction in a new basic block.
54 .size _start, .-_start
63 # No basic blocks above should have 4 successors! That is a bug.
64 # CHECK-NOT: Successors: {{.*}} (mispreds: 0, count: 20), {{.*}} (mispreds: 0, count: 0), {{.*}} (mispreds: 0, count: 0), {{.*}} (mispreds: 0, count: 0)
65 # Check successful removal of stray direct jmp
66 # CHECK: UCE removed 1 block