Hi Andre, hi all,
Andre Vehreschild wrote:
yes, I could have looked harder 🙂
I wrote ;-) on purpose as this feature is somewhat hidden and writing
'dg-do compile' doesn't harm.
In case of gcc/testsuite, the 'run' is also needed and were often missed
(or rather caused by invalid variants such as 'dg-run' (should be:
'dg-do run') or '{dg-do run }' (missing space after '{') prevented the
running of the code). Sam did fix some of those (and some other dg-*
issues) recently, e.g. in r15-2349-ga75c6295252d0d (→
https://gcc.gnu.org/r15-2349-ga75c6295252d0d ).
This isn't by any chance documented on the developer website of gcc somewhere?
It would be sad, if that knowledge is not publicy available for the future.
https://gcc.gnu.org/onlinedocs/gccint/Directives.html#Specify-how-to-build-the-test
documents it.
And libgomp has: lib/libgomp.exp:set dg-do-what-default run
The all arguments vs. only -O2 is set in libgomp via:
libgomp.c++/c++.exp:Â Â Â set DEFAULT_CFLAGS "-O2"
libgomp.c/c.exp:Â Â Â set DEFAULT_CFLAGS "-O2"
and for libgomp.*fortran/fortran.exp, the difference between 'dg-do run'
vs. default is *not* *documented,* but seems to be the result of the
following:
# For Fortran we're doing torture testing, as Fortran has far more tests
# with arrays etc. that testing just -O0 or -O2 is insufficient, that is
# typically not the case for C/C++.
gfortran-dg-runtest $tests "" ""
Tobias