Skip to content
Snippets Groups Projects
Commit bdc264a1 authored by Alexandre Oliva's avatar Alexandre Oliva Committed by Alexandre Oliva
Browse files

[testsuite] conditionalize dg-additional-sources on target and type

g++.dg/vect/pr95401.cc has dg-additional-sources, and that fails when
check_vect_support_and_set_flags finds vector support lacking for
execution tests: tests decay to compile tests, and additional sources
are rejected by the compiler when compiling to a named output file.

At first I considered using some effective target to conditionalize
the additional sources.  There was no support for target-specific
additional sources, so I added that.

But then, I found that adding an effective target to check whether the
test involves linking would just make for busy work in this case, and
so I went ahead and adjusted the handling of additional sources to
refrain from adding them on compile tests, reporting them as
unsupported.

That solves the problem without using the newly-added machinery for
per-target additional sources, but I figured since I'd implemented it
I might as well contribute it, since there might be other uses for it.


for  gcc/ChangeLog

	* doc/sourcebuild.texi (dg-additional-sources): Document
	newly-added support for target selectors, and implicit discard
	on non-linking tests that name the compiler output explicitly.

for  gcc/testsuite/ChangeLog

	* lib/gcc-defs.exp (dg-additional-sources): Support target
	selectors.  Make it cumulative.
	(dg-additional-files-options): Take dest and type.  Note
	unsupported additional sources when not linking and naming the
	compiler output.  Adjust source dirname prepending to cope
	with leading blanks.
	* lib/g++.exp (g++_target_compile): Pass dest and type on to
	dg-additional-files-options.
	* lib/gcc.exp (gcc_target_compile): Likewise.
	* lib/gdc.exp (gdb_target_compile): Likewise.
	* lib/gfortran.exp (gfortran_target_compile): Likewise.
	* lib/go.exp (go_target_compile): Likewise.
	* lib/obj-c++.exp (obj-c++_target_compile): Likewise.
	* lib/objc.exp (objc_target_compile): Likewise.
	* lib/rust.exp (rust_target_compile): Likewise.
	* lib/profopt.exp (profopt-execute): Likewise-ish.
parent c9842f99
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment