sim/testsuite: Default global_cc_os and global_cc_works properly
authorHans-Peter Nilsson <hp@axis.com>
Tue, 15 Feb 2022 22:29:07 +0000 (23:29 +0100)
committerHans-Peter Nilsson <hp@bitrange.com>
Tue, 15 Feb 2022 22:35:23 +0000 (23:35 +0100)
commite63f65fea9e87ba2d4daa78fb4c82c631c103f02
tree91d002f6059c30f95412dc072f6f1f359594979c
parentce20459e162175710d8ef56118fc34edabfdce5e
sim/testsuite: Default global_cc_os and global_cc_works properly

There was an omission on 3e6dc39ed7a8 "sim/testsuite: Set
global_cc_os also when no compiler is found"; global_cc_os
wasn't set for other than the primary target, which means
that the "unguarded" use of global_cc_os in
testsuite/cris/c/c.exp caused the dreaded "ERROR: can't read
"global_cc_os": no such variable" when e.g. configuring for
pru-elf and doing "make check-sim".  Better initializing
both variables at the top to default values, rather than
adding another single 'set global_cc_os ""', to reduce the
risk of not setting them properly if or when that
if-statement-chain is made longer.

sim/testsuite:
* lib/sim-defs.exp (sim_init_toolchain): Default
global_cc_os and global_cc_works properly, before if-chain.
sim/testsuite/lib/sim-defs.exp