From: Jonathan Wakely Date: Mon, 4 Sep 2023 14:23:23 +0000 (+0100) Subject: libstdc++: Fix broken tests for X-Git-Tag: basepoints/gcc-15~4791 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c02efd45f5e727ab8a1b397bce8817f4ab65954;p=thirdparty%2Fgcc.git libstdc++: Fix broken tests for When I added these tests I gave them .h file extensions, so they've never been run. They need to use the no_pch option, so that they only test the header and don't get via . libstdc++-v3/ChangeLog: * testsuite/26_numerics/headers/complex.h/std_c++11.h: Moved to... * testsuite/26_numerics/headers/complex.h/std_c++11.cc: ...here. * testsuite/26_numerics/headers/complex.h/std_c++98.h: Moved to... * testsuite/26_numerics/headers/complex.h/std_c++98.cc: ...here. Check macro first and then #undef. * testsuite/26_numerics/headers/complex.h/std_gnu++11.h: Moved to... * testsuite/26_numerics/headers/complex.h/std_gnu++11.cc: ...here. --- diff --git a/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.h b/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.cc similarity index 91% rename from libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.h rename to libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.cc index f74b13498d7a..5cac12181630 100644 --- a/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.h +++ b/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.cc @@ -15,7 +15,9 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=c++11" } +// { dg-do compile { target c++11 } } +// { dg-add-options strict_std } +// { dg-add-options no_pch } #include diff --git a/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.h b/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.cc similarity index 87% rename from libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.h rename to libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.cc index 79facef8d5bd..4c9bd6e6a08b 100644 --- a/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.h +++ b/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.cc @@ -15,13 +15,19 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=c++98" } +// { dg-do compile { target c++98_only } } +// { dg-add-options strict_std } +// { dg-add-options no_pch } #include -// Should be equivalent to C99 , not C++ +// Should be equivalent to C99 , not C++ +#ifndef complex +# error "'complex' is not defined as a macro by for -std=c++98" +#endif namespace std { +#undef complex struct complex; } @@ -49,7 +55,3 @@ namespace test using ::creal; } #endif - -#ifndef complex -# error "'complex' is not defined as a macro by for -std=c++98" -#endif diff --git a/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.h b/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.cc similarity index 95% rename from libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.h rename to libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.cc index 20c55a5944e5..4a6fc00d3909 100644 --- a/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.h +++ b/libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.cc @@ -15,7 +15,8 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-std=gnu++11" } +// { dg-do compile { target c++11 } } +// { dg-add-options no_pch } #include