public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Tidy gas i386.exp
@ 2020-09-17  8:15 Alan Modra
  2020-09-17  8:27 ` Andreas Schwab
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Modra @ 2020-09-17  8:15 UTC (permalink / raw)
  To: binutils

Possibly a quirk of my version of tcl, but I see "nm-new --help" being
run on non-x86 targets.

	* testsuite/gas/i386/i386.exp: Return early if not x86.

diff --git a/gas/testsuite/gas/i386/i386.exp b/gas/testsuite/gas/i386/i386.exp
index 0efcc8c7c2..132e5d7834 100644
--- a/gas/testsuite/gas/i386/i386.exp
+++ b/gas/testsuite/gas/i386/i386.exp
@@ -17,6 +17,10 @@
 #
 # i386 tests
 #
+if { ![istarget "i*86-*-*"] && ![istarget "x86_64-*-*"] } then {
+    return
+}
+
 proc gas_64_check { } {
     global NM
     global NMFLAGS
@@ -40,8 +44,7 @@ proc gas_bfd64_check { } {
     return [regexp "32bit/64bit/x32" [lindex $status 1]];
 }
 
-if [expr ([istarget "i*86-*-*"] ||  [istarget "x86_64-*-*"]) && [gas_32_check]]  then {
-
+if [gas_32_check] then {
     global ASFLAGS
     set old_ASFLAGS "$ASFLAGS"
     set ASFLAGS "$ASFLAGS --32"
@@ -674,42 +677,39 @@ if [expr ([istarget "i*86-*-*"] ||  [istarget "x86_64-*-*"]) && [gas_32_check]]
 }
 
 # Common tests
-if [expr [istarget "i*86-*-*"] || [istarget "x86_64-*-*"]] then {
-    if {![istarget "i*86-*-elfiamcu"] && [gas_64_check]} then {
-	run_dump_test "intel-expr"
-	run_dump_test "string-ok"
-    }
-    run_list_test "string-bad" ""
-    run_list_test "reg-bad" ""
-    run_list_test "space1" "-al"
-    run_list_test "xmmword" ""
-    run_dump_test rept
-    run_dump_test pr19498
-    run_list_test "nop-bad-1" ""
-    run_list_test "unspec" ""
-    if {[is_elf_format] || [istarget "*-*-vxworks*"]} then {
-	run_list_test_stdin "list-1" "-al"
-	run_list_test_stdin "list-2" "-al"
-	run_list_test_stdin "list-3" "-al"
-	run_dump_test "dw2-compress-1"
-	run_dump_test "dw2-compress-3a"
-	run_dump_test "dw2-compress-3b"
-	run_dump_test "dw2-compressed-1"
-	run_dump_test "dw2-compressed-3a"
-	run_dump_test "dw2-compressed-3b"
+if {![istarget "i*86-*-elfiamcu"] && [gas_64_check]} then {
+    run_dump_test "intel-expr"
+    run_dump_test "string-ok"
+}
+run_list_test "string-bad" ""
+run_list_test "reg-bad" ""
+run_list_test "space1" "-al"
+run_list_test "xmmword" ""
+run_dump_test rept
+run_dump_test pr19498
+run_list_test "nop-bad-1" ""
+run_list_test "unspec" ""
+if {[is_elf_format] || [istarget "*-*-vxworks*"]} then {
+    run_list_test_stdin "list-1" "-al"
+    run_list_test_stdin "list-2" "-al"
+    run_list_test_stdin "list-3" "-al"
+    run_dump_test "dw2-compress-1"
+    run_dump_test "dw2-compress-3a"
+    run_dump_test "dw2-compress-3b"
+    run_dump_test "dw2-compressed-1"
+    run_dump_test "dw2-compressed-3a"
+    run_dump_test "dw2-compressed-3b"
 
-	if {![istarget "*-*-dragonfly*"]
-	    && ![istarget "*-*-gnu*"]
-	    && ![istarget "*-*-freebsd*"]
-	    && ![istarget "*-*-linux*"]
-	    && ![istarget "*-*-netbsd*"]} then {
-	    run_dump_test "svr4"
-	}
+    if {![istarget "*-*-dragonfly*"]
+	&& ![istarget "*-*-gnu*"]
+	&& ![istarget "*-*-freebsd*"]
+	&& ![istarget "*-*-linux*"]
+	&& ![istarget "*-*-netbsd*"]} then {
+	run_dump_test "svr4"
     }
 }
 
-if [expr ([istarget "i*86-*-*"] || [istarget "x86_64-*-*"]) && [gas_64_check]] then {
-
+if [gas_64_check] then {
     global ASFLAGS
     set old_ASFLAGS "$ASFLAGS"
     set ASFLAGS "$ASFLAGS --64 --defsym x86_64=1 --strip-local-absolute"

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Tidy gas i386.exp
  2020-09-17  8:15 Tidy gas i386.exp Alan Modra
@ 2020-09-17  8:27 ` Andreas Schwab
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2020-09-17  8:27 UTC (permalink / raw)
  To: Alan Modra via Binutils

On Sep 17 2020, Alan Modra via Binutils wrote:

> Possibly a quirk of my version of tcl, but I see "nm-new --help" being
> run on non-x86 targets.

It's the lack of quoting, like the difference between:

% expr 0 && [expr 1 / 0]
divide by zero

and

% expr { 0 && [expr 1 / 0] }
0

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-17  8:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17  8:15 Tidy gas i386.exp Alan Modra
2020-09-17  8:27 ` Andreas Schwab

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).