xref: /llvm-project/bolt/test/X86/indirect-goto-pie.test (revision 887f7002b65f7376c7a5004535bd08c95bdaa8f8)
1## Check that llvm-bolt fails to process PIC binaries with computed goto, as the
2## support is not there yet for correctly updating dynamic relocations
3## referencing code inside functions.
4
5REQUIRES: x86_64-linux
6
7RUN: %clang %S/Inputs/indirect_goto.c -o %t -fpic -pie -Wl,-q
8RUN: not llvm-bolt %t -o %t.bolt --relocs=1 --print-cfg --print-only=main \
9RUN:   2>&1 | FileCheck %s
10
11## Check that processing works if main() is skipped.
12RUN: llvm-bolt %t -o %t.bolt --relocs=1 --skip-funcs=main
13
14CHECK:  jmpq    *%rax # UNKNOWN CONTROL FLOW
15
16CHECK: BOLT-ERROR: unable to get new address
17