summaryrefslogtreecommitdiff
path: root/test/old-elf/Mips/rel-high-01.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/old-elf/Mips/rel-high-01.test')
-rw-r--r--test/old-elf/Mips/rel-high-01.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/old-elf/Mips/rel-high-01.test b/test/old-elf/Mips/rel-high-01.test
new file mode 100644
index 000000000000..613fedbe31db
--- /dev/null
+++ b/test/old-elf/Mips/rel-high-01.test
@@ -0,0 +1,25 @@
+# REQUIRES: mips
+
+# Check handling R_MIPS_HIGHER / R_MIPS_HIGHEST relocations.
+
+# RUN: llvm-mc -arch=mips64el -filetype=obj -o=%t.o %s
+# RUN: lld -flavor old-gnu -target mips64el -e T0 -o %t.exe %t.o
+# RUN: llvm-objdump -d %t.exe | FileCheck %s
+
+# CHECK: Disassembly of section .text:
+# CHECK-NEXT: T0:
+# CHECK-NEXT: 120000250: 01 00 62 64 daddiu $2, $3, 1
+# CHECK-NEXT: 120000254: 00 00 62 64 daddiu $2, $3, 0
+#
+# CHECK: T1:
+# CHECK-NEXT: 120000258: 00 00 00 00 nop
+
+ .text
+ .globl T0
+T0:
+ daddiu $2, $3, %higher(T1)
+ daddiu $2, $3, %highest(T1)
+
+ .globl T1
+T1:
+ nop