aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite')
-rw-r--r--ld/testsuite/ld-loongarch-elf/relax-ttext.s13
-rw-r--r--ld/testsuite/ld-loongarch-elf/relax.exp12
2 files changed, 25 insertions, 0 deletions
diff --git a/ld/testsuite/ld-loongarch-elf/relax-ttext.s b/ld/testsuite/ld-loongarch-elf/relax-ttext.s
new file mode 100644
index 0000000..1bbd85a
--- /dev/null
+++ b/ld/testsuite/ld-loongarch-elf/relax-ttext.s
@@ -0,0 +1,13 @@
+# At relax pass 0, offset is 0x120204000-0x12000bff8=0x1f8008 < 0x200000
+# At relax pass 1, delete 0x7ff8 bytes NOP,
+# offset is 0x120204000-0x120004000=0x200000 >= 0x200000, overflow
+.text
+.align 14 # delete at relax pass 1
+.fill 0x4000
+.align 14 # delete at relax pass 1
+la.local $t2, a # relax to pcaddi at relax pass 0
+
+.section ".text1", "ax"
+ .fill 0x4000
+a: # 0x120204000
+ ret
diff --git a/ld/testsuite/ld-loongarch-elf/relax.exp b/ld/testsuite/ld-loongarch-elf/relax.exp
index 35caa73..4771f1e 100644
--- a/ld/testsuite/ld-loongarch-elf/relax.exp
+++ b/ld/testsuite/ld-loongarch-elf/relax.exp
@@ -51,6 +51,18 @@ if [istarget loongarch64-*-*] {
run_dump_test "relax-align-ignore-start"
run_partial_linking_align_test
+ run_ld_link_tests \
+ [list \
+ [list \
+ "loongarch relax ttext" \
+ "" "" \
+ "" \
+ {relax-ttext.s} \
+ {} \
+ "relax-ttext" \
+ ] \
+ ]
+
set testname "loongarch relax .exe build"
set pre_builds [list \
[list \