xref: /aosp_15_r20/external/llvm/test/tools/gold/X86/relax-relocs.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llvm-as %s -o %t.o
2*9880d681SAndroid Build Coastguard Worker; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so \
3*9880d681SAndroid Build Coastguard Worker; RUN:    --plugin-opt=save-temps \
4*9880d681SAndroid Build Coastguard Worker; RUN:    -shared %t.o -o %t.so
5*9880d681SAndroid Build Coastguard Worker; RUN: llvm-readobj -r %t.so.o | FileCheck %s
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; Test that we produce R_X86_64_GOTPCREL instead of R_X86_64_GOTPCRELX
8*9880d681SAndroid Build Coastguard Worker; CHECK: R_X86_64_GOTPCREL foo
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-unknown-linux-gnu"
11*9880d681SAndroid Build Coastguard Worker
12*9880d681SAndroid Build Coastguard Worker@foo = external global i32
13*9880d681SAndroid Build Coastguard Workerdefine i32 @bar() {
14*9880d681SAndroid Build Coastguard Worker  %t = load i32, i32* @foo
15*9880d681SAndroid Build Coastguard Worker  ret i32 %t
16*9880d681SAndroid Build Coastguard Worker}
17