Excerpts from Jakub Jelinek via Gcc-patches's message of Dezember 15, 2022 12:16 pm: > We seem to have a problem in other testsuites too: > grep ' valid for .*but not for' */*.log | sort -u > gcc/gcc.log:/home/jakub/src/gcc/gcc/testsuite/gcc.dg/pragma-diag-6.c:2:30: > warning: option '-Wnoexcept' is valid for C++/ObjC++ but not for C [-Wpragmas] > gdc/gdc.log:cc1plus: warning: command-line option '-fextern-std=c++11' is > valid for D but not for C++ > gdc/gdc.log:cc1plus: warning: command-line option '-fpreview=in' is valid for > D but not for C++ > gfortran/gfortran.log:cc1: warning: command-line option '-fcheck=all' is > valid for Fortran but not for C > g++/g++.log:cc1: warning: command-line option '-nostdinc++' is valid for > C++/ObjC++ but not for C > g++/g++.log:cc1: warning: command-line option '-std=gnu++11' is valid for > C++/ObjC++ but not for C > g++/g++.log:cc1: warning: command-line option '-std=gnu++14' is valid for > C++/ObjC++ but not for C > g++/g++.log:cc1: warning: command-line option '-std=gnu++17' is valid for > C++/ObjC++ but not for C > g++/g++.log:cc1: warning: command-line option '-std=gnu++20' is valid for > C++/ObjC++ but not for C > g++/g++.log:cc1: warning: command-line option '-std=gnu++23' is valid for > C++/ObjC++ but not for C > g++/g++.log:cc1: warning: command-line option '-std=gnu++98' is valid for > C++/ObjC++ but not for C > rust/rust.log:cc1plus: warning: command-line option > '-frust-incomplete-and-experimental-compiler-do-not-use' is valid for Rust > but not for C++ > rust/rust.log:cc1: warning: command-line option > '-frust-incomplete-and-experimental-compiler-do-not-use' is valid for Rust > but not for C > (of course, some of them could be from tests that this valid for but not for > messages work right, that is clearly the case of pragma-diag-6.c). > > In gcc/testsuite/lib/target-supports.exp (check_compile) we already > determine extension for the check_compile snippet based on magic comments > with default to .c (Rust nor Modula 2 don't have any, should that be > changed?), shouldn't we at that point based on the language filter out > known options that will not work? > > So, given the above, at least when in gdc testsuite and language is > not D filter out -fextern-std=* and -fpreview=in, for gfortran testsuite > and language not Fortran filter out -fcheck=all, when in g++ testsuite and > language is not C++ filter out -nostdinc++, -std=gnu++* and when > in rust testsuite and language is not Rust filter out > -frust-incomplete-and-experimental-compiler-do-not-use ? >
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? Iain.