1 # Check that llvm-bolt retpoline all indirect branches and the resulting binary
6 RUN: %clangxx %S/Inputs/retpoline_synthetic.cpp -fno-jump-tables -Wl,-q,-znow \
8 RUN: llvm-bolt %t.exe -o %t --insert-retpolines --trap-old-code
10 # Check indirect calls in the original binary
11 RUN: llvm-objdump -d %t.exe | FileCheck %s -check-prefix=CHECK-CALL-ORIG
12 CHECK-CALL-ORIG: callq *
14 RUN: llvm-objdump -d -j ".text" %t | FileCheck %s -check-prefix=CHECK-JUMP-ORIG
15 CHECK-JUMP-ORIG-NOT: jmpq *
17 # Check that there are no indirect calls or jumps in the resulting binary
18 RUN: llvm-objdump -d %t | FileCheck %s -check-prefix=CHECK-CALL
19 CHECK-CALL-NOT: callq *
20 RUN: llvm-objdump -d -j ".text" %t | FileCheck %s -check-prefix=CHECK-JUMP
21 CHECK-JUMP-NOT: jmpq *
23 # Check generated retpoline stub names
24 RUN: llvm-strings %t | FileCheck %s -check-prefix=CHECK-STRINGS
25 CHECK-STRINGS-DAG: __retpoline_%rax_
26 CHECK-STRINGS-DAG: __retpoline_mem_%rip+DATAat0x[[#]]
27 CHECK-STRINGS-DAG: __retpoline_mem_%rax+0
29 RUN: %t 1000 3 | FileCheck %s