aboutsummaryrefslogtreecommitdiff
path: root/test/ELF/x86-64-pcrel.s
diff options
context:
space:
mode:
authorYi Kong <yikong@google.com>2019-02-27 14:18:31 -0800
committerYi Kong <yikong@google.com>2019-02-27 14:18:31 -0800
commit35c021c49f44cd4e06875c4b1398a2b3464132bb (patch)
tree972f829a5ed4f0e4a14f0a713b49a8f0db93a26f /test/ELF/x86-64-pcrel.s
parent958317e226bf38ef5e647d0b056e8e95eb472c70 (diff)
parent14aa57da0f92683f0b8bdac0acda485a6f73edc7 (diff)
downloadlld-35c021c49f44cd4e06875c4b1398a2b3464132bb.tar.gz
Merge 14aa57da0 for LLVM update to 353983
Change-Id: Iee1792355bab030d81eb4cb645257dbac2537641
Diffstat (limited to 'test/ELF/x86-64-pcrel.s')
-rw-r--r--test/ELF/x86-64-pcrel.s23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ELF/x86-64-pcrel.s b/test/ELF/x86-64-pcrel.s
new file mode 100644
index 000000000..8129c9cab
--- /dev/null
+++ b/test/ELF/x86-64-pcrel.s
@@ -0,0 +1,23 @@
+// REQUIRES: x86
+
+// This is a test for R_X86_64_PC8 and R_X86_64_PC16.
+
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t1.o
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %p/Inputs/x86-64-pcrel.s -o %t2.o
+// RUN: ld.lld -o %t.exe %t1.o %t2.o
+// RUN: llvm-objdump -s %t.exe | FileCheck %s
+
+// CHECK: Contents of section .text:
+// CHECK-NEXT: 2000cccc cccccccc cccccccc cccccccc
+// CHECK-NEXT: 20cccccc cccccccc cccccccc cccccccc
+// CHECK-NEXT: e0ffcccc cccccccc cccccccc cccccccc
+// CHECK-NEXT: e0cccccc cccccccc cccccccc cccccccc
+
+.globl _start
+_start:
+
+.word foo - _start
+.fill 14,1,0xcc
+
+.byte foo - _start
+.fill 15,1,0xcc