xref: /llvm-project/llvm/test/tools/gold/X86/relocation-model-static.ll (revision a273c40820f78d8b08e411897eee84dbda983488)
1; RUN: llvm-as %s -o %t.o
2
3;; --noinhibit-exec allows undefined foo.
4; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
5; RUN:    --export-dynamic --noinhibit-exec \
6; RUN:    --plugin-opt=save-temps %t.o -o %t-out
7; RUN: llvm-readobj -r %t-out.lto.o | FileCheck %s --check-prefix=STATIC
8
9; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold%shlibext \
10; RUN:    -r \
11; RUN:    --plugin-opt=save-temps %t.o -o %t-out
12; RUN: llvm-readobj -r %t-out.lto.o | FileCheck %s --check-prefix=STATIC
13
14; STATIC: R_X86_64_PC32 foo
15
16target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
17target triple = "x86_64-unknown-linux-gnu"
18
19@foo = external dso_local global i32
20define i32 @main() {
21  %t = load i32, ptr @foo
22  ret i32 %t
23}
24