Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH][gdb/testsuite] Skip gdb.rust/*.exp for target board unix/-m32
@ 2021-01-18  8:49 Tom de Vries
  2021-01-20 19:55 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2021-01-18  8:49 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

Hi,

When running gdb.rust/*.exp with target board unix/-m32, we see:
...
Running src/gdb/testsuite/gdb.rust/union.exp ...
gdb compile failed, error: Unrecognized option: 'm'
Running src/gdb/testsuite/gdb.rust/modules.exp ...
gdb compile failed, error: Unrecognized option: 'm'
Running src/gdb/testsuite/gdb.rust/unsized.exp ...
gdb compile failed, error: Unrecognized option: 'm'
Running src/gdb/testsuite/gdb.rust/simple.exp ...
gdb compile failed, error: Unrecognized option: 'm'
Running src/gdb/testsuite/gdb.rust/watch.exp ...
gdb compile failed, error: Unrecognized option: 'm'
Running src/gdb/testsuite/gdb.rust/traits.exp ...
gdb compile failed, error: Unrecognized option: 'm'
Running src/gdb/testsuite/gdb.rust/expr.exp ...
Running src/gdb/testsuite/gdb.rust/rust-style.exp ...
gdb compile failed, error: Unrecognized option: 'm'
Running src/gdb/testsuite/gdb.rust/methods.exp ...
gdb compile failed, error: Unrecognized option: 'm'
Running src/gdb/testsuite/gdb.rust/generics.exp ...
gdb compile failed, error: Unrecognized option: 'm'
                === gdb Summary ===

nr of expected passes            95
nr of untested testcases         9
...

Fix this by testing for -m32 in the target board multilib_flags in
skip_rust_tests.

Tested on x86_64-linux.

Any comments?

Thanks,
- Tom

[gdb/testsuite] Skip gdb.rust/*.exp for target board unix/-m32

gdb/testsuite/ChangeLog:

2021-01-18  Tom de Vries  <tdevries@suse.de>

	* lib/gdb.exp (skip_rust_tests): Skip if multilib_flags contains -m32.

---
 gdb/testsuite/lib/gdb.exp | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index ae24fe2f49c..23792e04c70 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2185,7 +2185,22 @@ proc skip_d_tests {} {
 
 # Return 1 to skip Rust tests, 0 to try them.
 proc skip_rust_tests {} {
-    return [expr {![isnative]}]
+    if { ![isnative] } {
+	return 1
+    }
+
+    # The rust compiler does not support "-m32", skip.
+    global board board_info
+    set board [target_info name]
+    if {[board_info $board exists multilib_flags]} {
+	foreach flag [board_info $board multilib_flags] {
+	    if { $flag == "-m32" } {
+		return 1
+	    }
+	}
+    }
+
+    return 0
 }
 
 # Return a 1 for configurations that do not support Python scripting.

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

* Re: [PATCH][gdb/testsuite] Skip gdb.rust/*.exp for target board unix/-m32
  2021-01-18  8:49 [PATCH][gdb/testsuite] Skip gdb.rust/*.exp for target board unix/-m32 Tom de Vries
@ 2021-01-20 19:55 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2021-01-20 19:55 UTC (permalink / raw)
  To: Tom de Vries; +Cc: Tom Tromey, gdb-patches

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> Fix this by testing for -m32 in the target board multilib_flags in
Tom> skip_rust_tests.

Tom> Tested on x86_64-linux.

Tom> Any comments?

This seems fine.  Thank you for doing this.

There is a way to run rustc that would work here, but it requires the
user to use cargo to install a second rust toolchain.  So, maybe it's
not worth bothering with.

Tom

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

end of thread, other threads:[~2021-01-20 19:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18  8:49 [PATCH][gdb/testsuite] Skip gdb.rust/*.exp for target board unix/-m32 Tom de Vries
2021-01-20 19:55 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox