diff options
author | Hans-Peter Nilsson <hp@axis.com> | 2022-02-14 23:50:29 +0100 |
---|---|---|
committer | Hans-Peter Nilsson <hp@bitrange.com> | 2022-02-14 23:50:29 +0100 |
commit | 3e6dc39ed7a82facdc2b78c6f7a73ce5beff3cdf (patch) | |
tree | aee5cb0050a15b1353b785449426e2e55ae6331a /sim | |
parent | 3293b4f66797bb2ccd3dbbf170249556fc16ced7 (diff) | |
download | gdb-3e6dc39ed7a82facdc2b78c6f7a73ce5beff3cdf.zip gdb-3e6dc39ed7a82facdc2b78c6f7a73ce5beff3cdf.tar.gz gdb-3e6dc39ed7a82facdc2b78c6f7a73ce5beff3cdf.tar.bz2 |
sim/testsuite: Set global_cc_os also when no compiler is found
If we don't set this variable, it doesn't exist, and using "#progos:"
in an assembler-file will cause an error rather than just skipping the
test, viz:
Running /src/sim/testsuite/cris/hw/rv-n-cris/rvc.exp ...
ERROR: tcl error sourcing /src/sim/testsuite/cris/hw/rv-n-cris/rvc.exp.
ERROR: can't read "global_cc_os": no such variable
while executing
"if { $opts(progos) != "" && $opts(progos) != $global_cc_os } {
untested $subdir/$name
return
}"
(procedure "run_sim_test" line 102)
Neither the commit introducing progos, nor the top comment
in run_sim_test, mentions progos as intended only for C
tests, or that its use must be gated on $global_cc_works !=
0, so (not) setting it in the no-working-compiler path seems
just overlooked.
Allowing it to be used for assembler tests makes it usable
for e.g. an always-false predicate and in expressions in
.exp files without gating on $global_cc_works != 0.
With this patch, global_cc_os is set to "", just as for "unknown OS".
sim/testsuite:
* lib/sim-defs.exp (sim_init_toolchain): Set global_cc_os also when
no working target C compiler is found.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/testsuite/lib/sim-defs.exp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sim/testsuite/lib/sim-defs.exp b/sim/testsuite/lib/sim-defs.exp index 2cf739b..3586fa5 100644 --- a/sim/testsuite/lib/sim-defs.exp +++ b/sim/testsuite/lib/sim-defs.exp @@ -142,6 +142,7 @@ proc sim_init_toolchain {} { } { verbose -log "Can't execute C compiler" set global_cc_works 0 + set global_cc_os "" } file delete $objdir/compilercheck.x |