On Nov 7, 2023, Jonathan Wakely <jwak...@redhat.com> wrote: > An alternative approach for the g++ testsuite would be to provide a > set of dummy headers for the non-freestanding ones, so that all the > hosted-only headers are provided by the testsuite itself, but consist > of a single line:
> #error not available in freestanding > Then match on that and XFAIL. So the individual tests themselves > wouldn't need the dg-skip-if added to them, they would just > automatically XFAIL if they use a hosted-only header. *nod*. That wouldn't cover all the circumstances, alas: there are tests that fail in freestanding mode not because of headers, but because -fcontracts (currently?) links libstdc++exp in, and that library is not even built in freestanding mode. > The difficulty would be where to add those dummy headers for > <iostream>, <cstdio> etc. so that they're only found when testing a > non-hosted build. Maybe libstdc++ could provide them in the build dir > for the purposes of the testsuite, but not install them? We run install-tree testing, so that wouldn't quite work for us. If the headers are in some subdirectory in the source tree, that we (or the testsuite machinery) would just add to the -I set, that would help. -- Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer More tolerance and less prejudice are key for inclusion and diversity Excluding neuro-others for not behaving ""normal"" is *not* inclusive