GAS/MIPS: Fix testcase module-defer-warn2 for r2+ triples

Message ID 20230828043243.2243555-1-yunqiang.su@cipunited.com
State Accepted
Headers
Series GAS/MIPS: Fix testcase module-defer-warn2 for r2+ triples |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

YunQiang Su Aug. 28, 2023, 4:32 a.m. UTC
  When gas is configured with --target=mipsisa32r2el-elf, module-defer-warn2
will fail:

/binutils-gdb/gas/testsuite/gas/mips/module-defer-warn2.s: Assembler messages:
/binutils-gdb/gas/testsuite/gas/mips/module-defer-warn2.s:2: Error: `gp=64' used with a 32-bit processor
extra regexps in /binutils-gdb/gas/testsuite/gas/mips/module-defer-warn2.l starting with "^.*:2: .*: `fp=64' used with a 32-bit.*$"
EOF from dump.out
FAIL: mips module-defer-warn2

The reason is that fp64 is allowed for mips32r2 and onward, so
the error message `Error: `fp=64' used with a 32-bit fpu` won't emit.
---
 gas/testsuite/gas/mips/module-defer-warn2.l | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Maciej W. Rozycki Aug. 29, 2023, 2:46 p.m. UTC | #1
On Mon, 28 Aug 2023, YunQiang Su wrote:

> When gas is configured with --target=mipsisa32r2el-elf, module-defer-warn2
> will fail:
> 
> /binutils-gdb/gas/testsuite/gas/mips/module-defer-warn2.s: Assembler messages:
> /binutils-gdb/gas/testsuite/gas/mips/module-defer-warn2.s:2: Error: `gp=64' used with a 32-bit processor
> extra regexps in /binutils-gdb/gas/testsuite/gas/mips/module-defer-warn2.l starting with "^.*:2: .*: `fp=64' used with a 32-bit.*$"
> EOF from dump.out
> FAIL: mips module-defer-warn2
> 
> The reason is that fp64 is allowed for mips32r2 and onward, so
> the error message `Error: `fp=64' used with a 32-bit fpu` won't emit.

 It has to be a set of separate tests then, because the very purpose of 
the test is to verify all the error messages required are there.  Making 
any optional will defeat the purpose of the test and weaken coverage.

 It seems to me that the best course of action will be converting the test 
to the .d format first, which gives more control, and then split it into 
two, using #skip/#noskip tags as appropriate to select the right one for 
the respective targets.

  Maciej
  

Patch

diff --git a/gas/testsuite/gas/mips/module-defer-warn2.l b/gas/testsuite/gas/mips/module-defer-warn2.l
index bd37c299434..95ceb647b94 100644
--- a/gas/testsuite/gas/mips/module-defer-warn2.l
+++ b/gas/testsuite/gas/mips/module-defer-warn2.l
@@ -1,3 +1,3 @@ 
 .*: Assembler messages:
 .*:2: Error: `gp=64' used with a 32-bit.*
-.*:2: .*: `fp=64' used with a 32-bit.*
+#?.*:2: .*: `fp=64' used with a 32-bit.*