[PATCH 18/21] Fix failing test cases for linux and 64-bit target
Jovan Dmitrovic
jovan.dmitrovic@htecgroup.com
Wed Apr 2 12:18:47 GMT 2025
From: Faraz Shahbazker <fshahbazker@wavecomp.com>
Fixing tests for the MIPS architecture by adding a .space marker
to generate terminal sequences, updating test outputs, fixing
relocations, and enabling the use of 32-bit and 64-bit ABIs for
precise testing.
Cherry-picked 7abff2b
from https://github.com/MIPS/binutils-gdb
Signed-off-by: Faraz Shahbazker <fshahbazker@wavecomp.com>
Signed-off-by: Milica Matic <milica.matic@htecgroup.com>
gas/
* gas/testsuite/gas/mips/micromips.s: Add .space
marker to generate terminal sequence.
* gas/testsuite/gas/mips/micromipsr6@micromips.d: Update reference
output to match.
* gas/testsuite/gas/mips/llpscp-32-micromips.d: Set 32-bit ABI to
enable building with 64-bit default tools.
* gas/testsuite/gas/mips/llpscp-64-micromips.d: Fix relocations
to be section relative and force the ABI to n32.
---
gas/testsuite/gas/mips/llpscp-32-micromips.d | 2 +-
gas/testsuite/gas/mips/llpscp-64-micromips.d | 16 ++++++++--------
gas/testsuite/gas/mips/micromips.s | 4 +++-
gas/testsuite/gas/mips/micromipsr6@micromips.d | 3 +--
gas/testsuite/gas/mips/mips.exp | 2 ++
5 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/gas/testsuite/gas/mips/llpscp-32-micromips.d b/gas/testsuite/gas/mips/llpscp-32-micromips.d
index 36462f38599..52a22e8a91c 100644
--- a/gas/testsuite/gas/mips/llpscp-32-micromips.d
+++ b/gas/testsuite/gas/mips/llpscp-32-micromips.d
@@ -1,5 +1,5 @@
#objdump: -dr
-#as: -mips32r6 -mmicromips -meva
+#as: -32 -mips32r6 -mmicromips -meva
#name: Paired LL/SC for micromipsr6
#source: llpscp-32.s
diff --git a/gas/testsuite/gas/mips/llpscp-64-micromips.d b/gas/testsuite/gas/mips/llpscp-64-micromips.d
index 984197211c0..08416f260bf 100644
--- a/gas/testsuite/gas/mips/llpscp-64-micromips.d
+++ b/gas/testsuite/gas/mips/llpscp-64-micromips.d
@@ -1,5 +1,5 @@
#objdump: -dr
-#as: -mips64r6 -mmicromips
+#as: -mips64r6 -mmicromips -64 -mabi=n32
#name: Paired LL/SC for micromips mips64r6
#source: llpscp-64.s
@@ -13,16 +13,16 @@ Disassembly of section \.text:
8: 3044 1234 addiu v0,a0,4660
c: 6042 5000 lldp v0,zero,v0
10: 3062 0000 addiu v1,v0,0
- 10: R_MICROMIPS_LO16 sync_mem
+ 10: R_MICROMIPS_LO16 \.data
14: 6043 5030 lldp v0,v1,v1
18: 1040 0123 lui v0,0x123
1c: 0062 1150 addu v0,v0,v1
20: 3042 4567 addiu v0,v0,17767
24: 6042 5030 lldp v0,v1,v0
28: 1020 0000 lui at,0x0
- 28: R_MICROMIPS_HI16 sync_mem
+ 28: R_MICROMIPS_HI16 \.data
2c: 3021 0000 addiu at,at,0
- 2c: R_MICROMIPS_LO16 sync_mem
+ 2c: R_MICROMIPS_LO16 \.data
30: 0081 0950 addu at,at,a0
34: 6001 5000 lldp zero,zero,at
38: 6044 d030 scdp v0,v1,a0
@@ -30,16 +30,16 @@ Disassembly of section \.text:
40: 3024 1234 addiu at,a0,4660
44: 6041 d000 scdp v0,zero,at
48: 3022 0000 addiu at,v0,0
- 48: R_MICROMIPS_LO16 sync_mem
+ 48: R_MICROMIPS_LO16 \.data
4c: 6041 d030 scdp v0,v1,at
50: 1020 0123 lui at,0x123
54: 0061 0950 addu at,at,v1
58: 3021 4567 addiu at,at,17767
5c: 6041 d030 scdp v0,v1,at
60: 1020 0000 lui at,0x0
- 60: R_MICROMIPS_HI16 sync_mem
+ 60: R_MICROMIPS_HI16 .data
64: 3021 0000 addiu at,at,0
- 64: R_MICROMIPS_LO16 sync_mem
+ 64: R_MICROMIPS_LO16 \.data
68: 0081 0950 addu at,at,a0
6c: 6001 d000 scdp zero,zero,at
- ...
+ \.\.\.
diff --git a/gas/testsuite/gas/mips/micromips.s b/gas/testsuite/gas/mips/micromips.s
index 6a0a4247446..ccf62f85c4e 100644
--- a/gas/testsuite/gas/mips/micromips.s
+++ b/gas/testsuite/gas/mips/micromips.s
@@ -5960,5 +5960,7 @@ test_spec107:
bltzal $2, test_spec107
nop
.endif
-
.end test_spec107
+
+# Force at least 8 (non-delay-slot) zero bytes, to make 'objdump' print ...
+ .space 8
diff --git a/gas/testsuite/gas/mips/micromipsr6@micromips.d b/gas/testsuite/gas/mips/micromipsr6@micromips.d
index f0d5f89da75..fb0755c280d 100644
--- a/gas/testsuite/gas/mips/micromipsr6@micromips.d
+++ b/gas/testsuite/gas/mips/micromipsr6@micromips.d
@@ -4484,6 +4484,5 @@ Disassembly of section .text:
[ ]*[0-9a-f]+: [ ]*47df movep a0,a3,s4,s2
[ ]*[0-9a-f]+: [ ]*47ef movep a0,a3,s4,s3
[ ]*[0-9a-f]+: [ ]*47ff movep a0,a3,s4,s4
-[ ]*[0-9a-f]+: [ ]*0c00 nop
-[ ]*[0-9a-f]+: [ ]*0000 0000 nop
+ \.\.\.
#pass
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index b48dc403baf..7568d225711 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -2223,7 +2223,9 @@ if { [istarget mips*-*-vxworks*] } {
run_dump_test_arches "llpscp-32" [mips_arch_list_matching mips32r6 !micromipsr6]
run_dump_test "llpscp-32-micromips"
run_dump_test_arch "llpscp-64" "" mips64r6
+ if $has_newabi {
run_dump_test "llpscp-64-micromips"
+ }
run_dump_test_arches "crypto" [mips_arch_list_matching mips32r6 \
!micromipsr6]
--
2.34.1
More information about the Binutils
mailing list