When running test-case gdb.base/call-sc.exp with target board unix/-bad, I
get:
...
gdb compile failed, gcc: error: unrecognized command line option '-bad'
UNTESTED: gdb.base/call-sc.exp: failed to prepare
ERROR: tcl error sourcing src/gdb/testsuite/gdb.base/call-sc.exp.
ERROR: can't read "use_gdb_stub": no such variable
...
Fix this by checking the compilation result.
Fix the resulting DUPLICATE:
...
DUPLICATE: gdb.base/call-sc.exp: failed to prepare
...
using with_test_prefix.
Tested on x86_64-linux.
# Test every single char struct from 1..17 in size. This is what the
# original "scalars" test was doing.
-start_scalars_test tc
-test_scalar_calls
-test_scalar_returns
+proc test { type } {
+ with_test_prefix $type {
+ if { [start_scalars_test $type] == -1 } {
+ return
+ }
+ test_scalar_calls
+ test_scalar_returns
+ }
+}
+test tc
# Let the fun begin.
# naturally aligned. Padding being added where needed.
# Approx size: 2, 4, ...
-start_scalars_test ts
-test_scalar_calls
-test_scalar_returns
+test ts
# Approx size: 4, 8, ...
-start_scalars_test ti
-test_scalar_calls
-test_scalar_returns
+test ti
# Approx size: 4, 8, ...
-start_scalars_test tl
-test_scalar_calls
-test_scalar_returns
+test tl
# Approx size: 8, 16, ...
-start_scalars_test tll
-test_scalar_calls
-test_scalar_returns
+test tll
if {!$skip_float_test} {
# Approx size: 4, 8, ...
- start_scalars_test tf
- test_scalar_calls
- test_scalar_returns
+ test tf
# Approx size: 8, 16, ...
- start_scalars_test td
- test_scalar_calls
- test_scalar_returns
+ test td
# Approx size: 16, 32, ...
- start_scalars_test tld
- test_scalar_calls
- test_scalar_returns
+ test tld
}
# Approx size: 4, 8, ...
-start_scalars_test te
-test_scalar_calls
-test_scalar_returns
+test te
return 0