public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: YunQiang Su <yunqiang.su@cipunited.com>
To: macro@orcam.me.uk
Cc: binutils@sourceware.org, YunQiang Su <yunqiang.su@cipunited.com>
Subject: [PATCH v2] GAS/MIPS: Fix testcase module-defer-warn2 for r2+ triples
Date: Tue, 26 Sep 2023 07:20:35 -0400	[thread overview]
Message-ID: <20230926112035.2692284-1-yunqiang.su@cipunited.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2308291533200.43104@angie.orcam.me.uk>

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.

Let's convert this testcase to `.d' format,  and split it to
   module-defer-warn2-r2
   module-defer-warn2-prer2,
and use `skip/target` tags to select the right triples.
---
 gas/testsuite/gas/mips/mips.exp                              | 3 ++-
 gas/testsuite/gas/mips/module-defer-warn2-prer2.d            | 5 +++++
 .../{module-defer-warn2.l => module-defer-warn2-prer2.l}     | 0
 gas/testsuite/gas/mips/module-defer-warn2-r2.d               | 5 +++++
 gas/testsuite/gas/mips/module-defer-warn2-r2.l               | 2 ++
 5 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 gas/testsuite/gas/mips/module-defer-warn2-prer2.d
 rename gas/testsuite/gas/mips/{module-defer-warn2.l => module-defer-warn2-prer2.l} (100%)
 create mode 100644 gas/testsuite/gas/mips/module-defer-warn2-r2.d
 create mode 100644 gas/testsuite/gas/mips/module-defer-warn2-r2.l

diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 91cf8b11077..6e2b41d9e59 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -2059,7 +2059,8 @@ if { [istarget mips*-*-vxworks*] } {
 
     run_dump_test "module-override"
     run_dump_test "module-defer-warn1"
-    run_list_test "module-defer-warn2" "-32"
+    run_dump_test "module-defer-warn2-prer2"
+    run_dump_test "module-defer-warn2-r2"
 
     foreach testopt [list -mfp32 -mfpxx -mfp64 "-mfp64-noodd" \
 			  -msingle-float -msoft-float] {
diff --git a/gas/testsuite/gas/mips/module-defer-warn2-prer2.d b/gas/testsuite/gas/mips/module-defer-warn2-prer2.d
new file mode 100644
index 00000000000..9b2b3c4b51a
--- /dev/null
+++ b/gas/testsuite/gas/mips/module-defer-warn2-prer2.d
@@ -0,0 +1,5 @@
+#name: .module deferred warnings 2 (pre-R2)
+#source: module-defer-warn2.s
+#as: -32
+#skip: mipsisa32r?* mipsisa64r?*
+#error_output: module-defer-warn2-prer2.l
diff --git a/gas/testsuite/gas/mips/module-defer-warn2.l b/gas/testsuite/gas/mips/module-defer-warn2-prer2.l
similarity index 100%
rename from gas/testsuite/gas/mips/module-defer-warn2.l
rename to gas/testsuite/gas/mips/module-defer-warn2-prer2.l
diff --git a/gas/testsuite/gas/mips/module-defer-warn2-r2.d b/gas/testsuite/gas/mips/module-defer-warn2-r2.d
new file mode 100644
index 00000000000..07504379d3b
--- /dev/null
+++ b/gas/testsuite/gas/mips/module-defer-warn2-r2.d
@@ -0,0 +1,5 @@
+#name: .module deferred warnings 2 (R2+)
+#source: module-defer-warn2.s
+#as: -32
+#target: mipsisa32r?* mipsisa64r?*
+#error_output: module-defer-warn2-r2.l
diff --git a/gas/testsuite/gas/mips/module-defer-warn2-r2.l b/gas/testsuite/gas/mips/module-defer-warn2-r2.l
new file mode 100644
index 00000000000..5f22ef4d413
--- /dev/null
+++ b/gas/testsuite/gas/mips/module-defer-warn2-r2.l
@@ -0,0 +1,2 @@
+.*: Assembler messages:
+.*:2: Error: `gp=64' used with a 32-bit.*
-- 
2.39.2


  reply	other threads:[~2023-09-26 11:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-28  4:32 [PATCH] " YunQiang Su
2023-08-29 14:46 ` Maciej W. Rozycki
2023-09-26 11:20   ` YunQiang Su [this message]
2023-09-28 23:46     ` [PATCH v2] " Maciej W. Rozycki
2023-09-29 13:41       ` YunQiang Su
2023-09-29 14:18         ` Maciej W. Rozycki
2023-09-29 14:23           ` YunQiang Su
2023-09-29 14:32             ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230926112035.2692284-1-yunqiang.su@cipunited.com \
    --to=yunqiang.su@cipunited.com \
    --cc=binutils@sourceware.org \
    --cc=macro@orcam.me.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).