From: Alexandre Oliva Date: Thu, 30 May 2024 07:01:19 +0000 (-0300) Subject: [testsuite] conditionalize dg-additional-sources on target and type X-Git-Tag: basepoints/gcc-16~8631 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d71818602f2a7f3b15a811fb20a84d2a177a8e5;p=thirdparty%2Fgcc.git [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. ---