[ELF] Use llvm-mc rather than checking in a file.
authorDavide Italiano <davide@freebsd.org>
Sun, 24 Apr 2016 01:56:02 +0000 (01:56 +0000)
committerDavide Italiano <davide@freebsd.org>
Sun, 24 Apr 2016 01:56:02 +0000 (01:56 +0000)
Now that the support for the 'new' relocations is available.

llvm-svn: 267310

lld/test/ELF/Inputs/gotpcrelx.o [deleted file]
lld/test/ELF/gotpcrelx.s

diff --git a/lld/test/ELF/Inputs/gotpcrelx.o b/lld/test/ELF/Inputs/gotpcrelx.o
deleted file mode 100644 (file)
index 0300658..0000000
Binary files a/lld/test/ELF/Inputs/gotpcrelx.o and /dev/null differ
index b8e8c89..169a479 100644 (file)
@@ -1,12 +1,19 @@
-// RUN: ld.lld %p/Inputs/gotpcrelx.o -o %t.so -shared
+// RUN: llvm-mc -filetype=obj -relax-relocations -triple x86_64-pc-linux-gnu \
+// RUN: %s -o %t.o
+// RUN: llvm-readobj -r %t.o | FileCheck --check-prefix=RELS %s
+// RUN: ld.lld %t.o -o %t.so -shared
 // RUN: llvm-readobj -s -r %t.so | FileCheck %s
 
-// The gotpcrelx.o is just this file assembled with gas. We should switch to
-// llvm-mc once it starts producing R_X86_64_GOTPCRELX and
-// R_X86_64_REX_GOTPCRELX.
 movq foo@GOTPCREL(%rip), %rax
 movl bar@GOTPCREL(%rip), %eax
 
+// RELS: Relocations [
+// RELS-NEXT:   Section ({{.*}}) .rela.text {
+// RELS-NEXT:     0x3 R_X86_64_REX_GOTPCRELX foo 0xFFFFFFFFFFFFFFFC
+// RELS-NEXT:     0x9 R_X86_64_GOTPCRELX bar 0xFFFFFFFFFFFFFFFC
+// RELS-NEXT:   }
+// RELS-NEXT: ]
+
 // CHECK:      Name: .got
 // CHECK-NEXT: Type: SHT_PROGBITS
 // CHECK-NEXT: Flags [