outputs.exp: skip @file -save-temps if target has -L or -I
authorHans-Peter Nilsson <hp@axis.com>
Thu, 25 Feb 2021 04:07:37 +0000 (05:07 +0100)
committerHans-Peter Nilsson <hp@axis.com>
Tue, 2 Mar 2021 23:15:17 +0000 (00:15 +0100)
commit7fddf3dbb98a5824140da0bb442738f54031d3bf
tree91601487d161da150ad3af232868729096bd02d1
parent8b6ebc025cf2b25fdc1e8f6e6261701dc71bac74
outputs.exp: skip @file -save-temps if target has -L or -I

The outputs.exp tests check what temporary files are created
and left behind with e.g. -save-temps.

Additional files are created in presence of @file option.
Adding an -I or -L option causes *another* temporary file to
appear.  I take it that's deliberate, as there are tests for
that behavior.

For native testing, the default test-framework baseboard
file unix.exp doesn't add any -I or -L options and all tests
pass.  For a newlib target however, you'll have a couple of
-L options (see the nopts handling in outputs.exp), leading
to:

Running /x/gcc/gcc/testsuite/gcc.misc-tests/outputs.exp ...
FAIL: outputs exe savetmp namedb: extra
outputs.args.1
FAIL: outputs exe savetmp named2: extra
outputs.args.1
FAIL: outputs exe savetmp named2: extra
outputs.args.3
FAIL: outputs lto sing unnamed: extra
a.args.1

The failing tests are among the actual tests that check the
behavior of @file, and are confused by the additional -L.

Identify presence of -I or -L from the test framework and
skip those tests.

Tested cris-elf and x86_64-pc-linux-gnu.

gcc/testsuite:
* gcc.misc-tests/outputs.exp: Skip @file -save-temps
tests if target test-framework has -L or -I options.
gcc/testsuite/gcc.misc-tests/outputs.exp