summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lld/test/ELF/lto/relax-relocs.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/lld/test/ELF/lto/relax-relocs.ll b/lld/test/ELF/lto/relax-relocs.ll
new file mode 100644
index 00000000000..929e124b2d8
--- /dev/null
+++ b/lld/test/ELF/lto/relax-relocs.ll
@@ -0,0 +1,15 @@
+; RUN: llvm-as %s -o %t.o
+; RUN: ld.lld -m elf_x86_64 -save-temps -shared %t.o -o %t.so
+; RUN: llvm-readobj -r %t.so.lto.o | FileCheck %s
+
+; Test that we produce R_X86_64_REX_GOTPCRELX instead of R_X86_64_GOTPCREL
+; CHECK: R_X86_64_REX_GOTPCRELX foo
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-unknown-linux-gnu"
+
+@foo = external global i32
+define i32 @bar() {
+ %t = load i32, i32* @foo
+ ret i32 %t
+}
OpenPOWER on IntegriCloud