aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-loongarch-elf/64_pcrel.d4
-rw-r--r--ld/testsuite/ld-loongarch-elf/64_pcrel.s11
-rw-r--r--ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp16
3 files changed, 31 insertions, 0 deletions
diff --git a/ld/testsuite/ld-loongarch-elf/64_pcrel.d b/ld/testsuite/ld-loongarch-elf/64_pcrel.d
new file mode 100644
index 0000000..2ea063b
--- /dev/null
+++ b/ld/testsuite/ld-loongarch-elf/64_pcrel.d
@@ -0,0 +1,4 @@
+#...
+.*0xffffbffc.*
+.*0xffffffff.*
+#pass
diff --git a/ld/testsuite/ld-loongarch-elf/64_pcrel.s b/ld/testsuite/ld-loongarch-elf/64_pcrel.s
new file mode 100644
index 0000000..68af590
--- /dev/null
+++ b/ld/testsuite/ld-loongarch-elf/64_pcrel.s
@@ -0,0 +1,11 @@
+.text
+ nop
+ nop
+L1:
+ nop
+.data
+ nop
+ nop
+ .8byte 0x1234567812345678
+ .reloc 0,R_LARCH_64_PCREL,L1
+ nop
diff --git a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
index 50a1208..b95cc53 100644
--- a/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
+++ b/ld/testsuite/ld-loongarch-elf/ld-loongarch-elf.exp
@@ -40,3 +40,19 @@ if [istarget "loongarch32-*-*"] {
run_dump_test "syscall"
run_dump_test "disas-jirl-32"
}
+
+if [istarget "loongarch64-*-*"] {
+ run_ld_link_tests \
+ [list \
+ [list \
+ "64_pcrel" \
+ "-e 0x0 -z relro" "" \
+ "" \
+ {64_pcrel.s} \
+ [list \
+ [list objdump -D 64_pcrel.d] \
+ ] \
+ "64_pcrel" \
+ ] \
+ ]
+}