brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 394d018 Raw
31 lines · plain
1# Check that llvm-bolt retpoline all indirect branches and the resulting binary2# correctly runs.3 4REQUIRES: x86_64-linux5 6RUN: %clangxx %S/Inputs/retpoline_synthetic.cpp -fno-jump-tables -Wl,-q,-znow \7RUN:   -O2 -o %t.exe8RUN: llvm-bolt %t.exe -o %t --insert-retpolines --trap-old-code9 10# Check indirect calls in the original binary11RUN: llvm-objdump -d %t.exe | FileCheck %s -check-prefix=CHECK-CALL-ORIG12CHECK-CALL-ORIG: callq  *13# No indirect jumps14RUN: llvm-objdump -d -j ".text" %t | FileCheck %s -check-prefix=CHECK-JUMP-ORIG15CHECK-JUMP-ORIG-NOT: jmpq   *16 17# Check that there are no indirect calls or jumps in the resulting binary18RUN: llvm-objdump -d %t | FileCheck %s -check-prefix=CHECK-CALL19CHECK-CALL-NOT: callq  *20RUN: llvm-objdump -d -j ".text" %t | FileCheck %s -check-prefix=CHECK-JUMP21CHECK-JUMP-NOT: jmpq   *22 23# Check generated retpoline stub names24RUN: llvm-strings %t | FileCheck %s -check-prefix=CHECK-STRINGS25CHECK-STRINGS-DAG: __retpoline_%rax_26CHECK-STRINGS-DAG: __retpoline_mem_%rip+DATAat0x[[#]]27CHECK-STRINGS-DAG: __retpoline_mem_%rax+028 29RUN: %t 1000 3 | FileCheck %s30CHECK: 3000000031