aboutsummaryrefslogtreecommitdiff
path: root/test/old-elf/Mips/r26-2.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/old-elf/Mips/r26-2.test')
-rw-r--r--test/old-elf/Mips/r26-2.test31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/old-elf/Mips/r26-2.test b/test/old-elf/Mips/r26-2.test
new file mode 100644
index 000000000000..b9db959d3ea7
--- /dev/null
+++ b/test/old-elf/Mips/r26-2.test
@@ -0,0 +1,31 @@
+# REQUIRES: mips
+
+# Check reading addendum for R_MIPS_26 relocation.
+# RUN: llvm-mc -arch=mipsel -filetype=obj -o=%t.o %s
+# RUN: lld -flavor old-gnu -target mipsel -o %t.exe %t.o
+# RUN: llvm-objdump -d %t.exe | FileCheck %s
+
+# CHECK: Disassembly of section .text:
+# CHECK-NEXT: __start:
+# CHECK-NEXT: 400180: 60 70 10 0c jal 4309376
+# CHECK-NEXT: 400184: 00 00 00 00 nop
+# CHECK-NEXT: 400188: 68 70 10 0c jal 4309408
+# CHECK-NEXT: 40018c: 00 00 00 00 nop
+# CHECK-NEXT: 400190: 5f 00 10 0c jal 4194684
+# CHECK-NEXT: 400194: 00 00 00 00 nop
+# CHECK-NEXT: 400198: 67 00 10 0c jal 4194716
+# CHECK-NEXT: 40019c: 00 00 00 00 nop
+#
+# CHECK: loc:
+# CHECK-NEXT: 4001a0: 00 00 00 00 nop
+
+ .text
+ .globl __start
+__start:
+ jal __start + 0x1C000
+ jal loc + 0x1C000
+ jal __start + (-1)
+ jal loc + (-1)
+
+loc:
+ nop