On Thu, Dec 15, 2022 at 12:39:38PM +0100, Iain Buclaw wrote: > For the gdc testsuite, those warnings arise because both language files > are compiled in the same invocation (dg-additional-sources "cpp11.cpp"), > so it ends up looking something like: > > gdc -fextern-std=c++11 testcpp11.d cpp11.cpp -o testcpp11.exe > > So ruling out some sort of filtering done by the gdc driver when > delegating calls to the C/C++/D language compilers, is there a way to > get dejagnu to compile dg-additional-sources one-at-a-time?
Through extra code in *.exp file certainly, invoke gdc -c cpp11.cpp -o cpp11.o and gdc -fextern-std=c++11 testcpp11.d cpp11.o -o testcpp11.exe afterwards, but for dg-additional-sources I don't think so. Maybe it would be nice to be able to pass options only to a certain gcc backend binary and not to others, similarly to how -Wa,option passes options to assembler, -Wp,option to preprocessor and -Wl,option to linker. -Wc,language,option ? Then one could gdc -Wc,d,-fextern-std=c++11 testcpp11.d cpp11.cpp -o testcpp11.exe or gccrs -Wc,rust,-frust-incomplete-and-experimental-compiler-do-not-use whatever.rs something.c -o whatever etc. If we do, one would need to use it with care, because then e.g. for gcc -Wc,c,-fsanitize=address the driver wouldn't know it should link in -lasan etc. Jakub