1 # This test ensures that "unclaimed" jump table entries are accounted later
2 # in postProcessIndirectBranches and the function is marked as non-simple.
4 # The test is compiled from the following source using GCC 12.2 -O3:
5 # https://godbolt.org/z/YcPG131s6
6 # int func(long long Input) {
13 # default: __builtin_unreachable();
17 # REQUIRES: system-linux
19 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
20 # RUN: %clang %cflags %S/Inputs/unclaimed-jt-entries.c -no-pie %t.o -o %t.exe -Wl,-q
21 # RUN: llvm-bolt %t.exe -v=1 -o %t.out --sequential-disassembly |& FileCheck %s
23 # CHECK: BOLT-WARNING: unclaimed data to code reference (possibly an unrecognized jump table entry) to .Ltmp[[#]] in func
24 # CHECK: BOLT-WARNING: unclaimed data to code reference (possibly an unrecognized jump table entry) to .Ltmp[[#]] in func
25 # CHECK: BOLT-WARNING: unclaimed data to code reference (possibly an unrecognized jump table entry) to .Ltmp[[#]] in func
26 # CHECK: BOLT-WARNING: unclaimed data to code reference (possibly an unrecognized jump table entry) to .Ltmp[[#]] in func
27 # CHECK: BOLT-WARNING: unclaimed data to code reference (possibly an unrecognized jump table entry) to .Ltmp[[#]] in func
28 # CHECK: BOLT-WARNING: failed to post-process indirect branches for func
30 # Run the optimized binary
31 # RUN: %t.out 3 | FileCheck %s --check-prefix=CHECK3
33 # RUN: %t.out 4 | FileCheck %s --check-prefix=CHECK4
35 # RUN: %t.out 6 | FileCheck %s --check-prefix=CHECK6
37 # RUN: %t.out 8 | FileCheck %s --check-prefix=CHECK8
39 # RUN: %t.out 13 | FileCheck %s --check-prefix=CHECK13
45 .size func, .Lend-func