]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Skip gdb.rust/*.exp for target board unix/-m32
authorTom de Vries <tdevries@suse.de>
Wed, 20 Jan 2021 21:02:33 +0000 (22:02 +0100)
committerTom de Vries <tdevries@suse.de>
Wed, 20 Jan 2021 21:02:33 +0000 (22:02 +0100)
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.

gdb/testsuite/ChangeLog:

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

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

gdb/testsuite/ChangeLog
gdb/testsuite/lib/gdb.exp

index a0211565d2e91c387bac1ff05a1f40a222d762ba..b197b0b4e5a1c8a08e9190ad2cf1e8cf45f65edd 100644 (file)
@@ -1,3 +1,7 @@
+2021-01-20  Tom de Vries  <tdevries@suse.de>
+
+       * lib/gdb.exp (skip_rust_tests): Skip if multilib_flags contains -m32.
+
 2021-01-20  Sergio Durigan Junior  <sergiodj@sergiodj.net>
 
        * gdb.arch/amd64-stap-expressions.S: New file.
index ae24fe2f49c99ee5cdc30347c1acfea7a9c07571..23792e04c70665d5aa3c19fd3e15148f4959acb0 100644 (file)
@@ -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.