binutils-gdb/ld/testsuite/ld-gc
Sandra Loosemore 44ed80923a Use better test for usable compiler in ld testsuite.
The ld testsuite includes numerous tests that depend on being able to
compile and link programs with the C compiler.  Some of these tests
use [which $CC] to check for the presence of the compiler before
proceeding with the test, but run_ld_link_exec_tests and run_cc_link_tests
give ERRORs if compilation fails.  Also, even if $CC is defined and present,
it may not be usable due to missing libraries, etc.

This patch adds a new procedure check_compiler_available that attempts
to build an empty program and caches the result.  Uses of [which $CC]
are replaced with calls to this procedure, and run_ld_link_exec_tests
and run_cc_link_tests now also guard attempts to use $CC.

2019-04-24  Sandra Loosemore  <sandra@codesourcery.com>

	ld/
	* testsuite/config/default.exp: Use [check_compiler_available]
	instead of [which $CC].
	* testsuite/ld-auto-import/auto-import.exp: Likewise.
	* testsuite/ld-cygwin/exe-export.exp: Likewise.
	* testsuite/ld-elf/audit.exp: Likewise.
	* testsuite/ld-elf/compress.exp: Likewise.
	* testsuite/ld-elf/dwarf.exp: Likewise.
	* testsuite/ld-elf/elf.exp: Likewise.
	* testsuite/ld-elf/indirect.exp: Likewise.
	* testsuite/ld-elf/linux-x86.exp: Likewise.
	* testsuite/ld-elf/shared.exp: Likewise.
	* testsuite/ld-elf/tls.exp: Likewise.
	* testsuite/ld-elf/wrap.exp: Likewise.
	* testsuite/ld-elfcomm/elfcomm.exp: Likewise.
	* testsuite/ld-elfvers/vers.exp: Likewise.
	* testsuite/ld-elfvsb/elfvsb.exp: Likewise.
	* testsuite/ld-elfweak/elfweak.exp: Likewise.
	* testsuite/ld-gc/gc.exp: Likewise.
	* testsuite/ld-i386/i386.exp: Likewise.
	* testsuite/ld-i386/no-plt.exp: Likewise.
	* testsuite/ld-i386/tls.exp: Likewise.
	* testsuite/ld-ifunc/ifunc.exp: Likewise.
	* testsuite/ld-mn10300/mn10300.exp: Likewise.
	* testsuite/ld-pe/pe-compile.exp: Likewise.
	* testsuite/ld-pe/pe-run.exp: Likewise.
	* testsuite/ld-pe/pe-run2.exp: Likewise.
	* testsuite/ld-pie/pie.exp: Likewise.
	* testsuite/ld-plugin/lto.exp: Likewise.
	* testsuite/ld-plugin/plugin.exp: Likewise.
	* testsuite/ld-scripts/crossref.exp: Likewise.
	* testsuite/ld-sh/sh.exp: Likewise.
	* testsuite/ld-shared/shared.exp: Likewise.
	* testsuite/ld-size/size.exp: Likewise.
	* testsuite/ld-srec/srec.exp: Likewise.
	* testsuite/ld-undefined/undefined.exp: Likewise.
	* testsuite/ld-unique/unique.exp: Likewise.
	* testsuite/ld-x86-64/mpx.exp: Likewise.
	* testsuite/ld-x86-64/no-plt.exp: Likewise.
	* testsuite/ld-x86-64/tls.exp: Likewise.
	* testsuite/ld-x86-64/x86-64.exp: Likewise.
	* testsuite/lib/ld-lib.exp (run_ld_link_exec_tests): Call
	check_compiler_available before trying to use the compiler.
	(run_cc_link_tests): Likewise.
	(check_compiler_available): New.  Use it instead of [which $CC].
2019-04-24 12:14:56 -07:00
..
abi-note.d [ARM] FDPIC: Update testsuite so that many tests pass with arm*-uclinuxfdpiceabi. 2018-04-25 21:13:14 +00:00
abi-note.s
all-debug-sections.d Remove run_dump_test support for objcopy as a dump program 2018-09-15 16:24:18 +09:30
all-debug-sections.s
dummy.s
gc.c
gc.exp Use better test for usable compiler in ld testsuite. 2019-04-24 12:14:56 -07:00
libpersonality.s
noent.d
noent.s
personality.d Consolidate run_dump_test 2018-09-15 16:56:55 +09:30
personality.s
pr11218-1.c
pr11218-2.c
pr11218.d [ARM] FDPIC: Update testsuite so that many tests pass with arm*-uclinuxfdpiceabi. 2018-04-25 21:13:14 +00:00
pr13683.c
pr13683.d Remove sh5 and sh64 support 2018-04-16 15:29:39 +09:30
pr14265.c
pr14265.d Fix some AVR test failures. 2016-05-04 13:03:52 +01:00
pr14265.t
pr18223.d
pr18223.s
pr19161-1.c Always keep sections marked with SEC_KEEP 2015-10-22 12:23:03 -07:00
pr19161-2.c Always keep sections marked with SEC_KEEP 2015-10-22 12:23:03 -07:00
pr19161.d Remove pr19161 test hppa xfail 2017-08-23 08:58:42 +09:30
pr19167.d ld testsuite use of notarget 2018-07-10 23:58:29 +09:30
pr19167a.s Add a test for PR ld/19167 2015-10-23 04:23:51 -07:00
pr19167b.s Add a test for PR ld/19167 2015-10-23 04:23:51 -07:00
pr20022.d Revise "ld testsuite use of notarget" 2018-07-11 16:39:04 +09:30
pr20022a.s Add size to bar in ld-gc/pr20022a.s 2017-06-14 05:52:12 -07:00
pr20022b.s Revise "ld testsuite use of notarget" 2018-07-11 16:39:04 +09:30
pr20306.c Skip version check for unreferenced and undefined symbol 2016-06-28 08:08:30 -07:00
pr20306.d Skip version check for unreferenced and undefined symbol 2016-06-28 08:08:30 -07:00
pr20882.d GC: Also check the local debug definition section 2018-03-14 04:23:40 -07:00
pr20882a.s pr20882 testcase 2017-05-18 14:28:17 +09:30
pr20882b.s GC: Also check the local debug definition section 2018-03-14 04:23:40 -07:00
pr20882c.s pr20882 testcase 2017-05-18 14:28:17 +09:30
skip-map-discarded.d ld: Add --no-print-map-discarded option 2019-04-11 10:16:31 -07:00
skip-map-discarded.map ld: Add --no-print-map-discarded option 2019-04-11 10:16:31 -07:00
skip-map-discarded.s s12z and h8300 no-print-map-discarded fails 2019-04-19 12:41:58 +09:30
start.d ld testsuite use of notarget 2018-07-10 23:58:29 +09:30
start.s
stop.d ld testsuite use of notarget 2018-07-10 23:58:29 +09:30
stop.s Add --gc-sections test checking removal of __start/__stop symbols. 2018-01-30 22:13:43 +10:30