summaryrefslogtreecommitdiff
path: root/test/ELF/mips-64-gprel-so.s
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-07-23 20:48:50 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-07-23 20:48:50 +0000
commit1c98619801a5705c688e683be3ef9d70169a0686 (patch)
tree8422105cd1a94c368315f2db16b9ac746cf7c000 /test/ELF/mips-64-gprel-so.s
parentf4f3ce4613680903220815690ad79fc7ba0a2e26 (diff)
Notes
Diffstat (limited to 'test/ELF/mips-64-gprel-so.s')
-rw-r--r--test/ELF/mips-64-gprel-so.s23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/ELF/mips-64-gprel-so.s b/test/ELF/mips-64-gprel-so.s
new file mode 100644
index 0000000000000..437238ef5f269
--- /dev/null
+++ b/test/ELF/mips-64-gprel-so.s
@@ -0,0 +1,23 @@
+# Check setup of GP relative offsets in a function's prologue.
+
+# RUN: llvm-mc -filetype=obj -triple=mips64-unknown-linux %s -o %t.o
+# RUN: ld.lld %t.o -shared -o %t.so
+# RUN: llvm-objdump -d -t %t.so | FileCheck %s
+
+# REQUIRES: mips
+
+# CHECK: Disassembly of section .text:
+# CHECK-NEXT: foo:
+# CHECK-NEXT: 10000: 3c 1c 00 01 lui $gp, 1
+# CHECK-NEXT: 10004: 03 99 e0 2d daddu $gp, $gp, $25
+# CHECK-NEXT: 10008: 67 9c 7f f0 daddiu $gp, $gp, 32752
+
+# CHECK: 0000000000027ff0 .got 00000000 .hidden _gp
+# CHECK: 0000000000010000 .text 00000000 foo
+
+ .text
+ .global foo
+foo:
+ lui $gp,%hi(%neg(%gp_rel(foo)))
+ daddu $gp,$gp,$t9
+ daddiu $gp,$gp,%lo(%neg(%gp_rel(foo)))