xref: /llvm-project/bolt/test/X86/jump-table-fixed-ref-pic.test (revision 3023b15fb1ec00dbe6a1cb630236125f500978ef)
111791ae7SSayhaan Siddiqui## Verify that BOLT detects fixed destination of indirect jump for PIC
211791ae7SSayhaan Siddiqui## case.
373a01448SMaksim Panchenko
473a01448SMaksim PanchenkoRUN: %clang %cflags -no-pie %S/Inputs/jump-table-fixed-ref-pic.s -Wl,-q -o %t
5*3023b15fSAmir AyupovRUN: llvm-bolt %t --relocs -o %t.null -print-cfg 2>&1 | FileCheck %s
673a01448SMaksim Panchenko
7*3023b15fSAmir AyupovCHECK: BOLT-INFO: fixed PIC indirect branch detected in main {{.*}} the destination value is 0x[[#TGT:]]
8*3023b15fSAmir AyupovCHECK: Binary Function "main" after building cfg
9*3023b15fSAmir Ayupov
10*3023b15fSAmir AyupovCHECK:      movslq ".rodata/1"+8(%rip), %rax
11*3023b15fSAmir AyupovCHECK-NEXT: leaq ".rodata/1"(%rip), %rdx
12*3023b15fSAmir AyupovCHECK-NEXT: addq %rdx, %rax
13*3023b15fSAmir AyupovCHECK-NEXT: jmpq *%rax # UNKNOWN CONTROL FLOW
14