aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/26_numerics
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-09-04 15:23:23 +0100
committerJonathan Wakely <jwakely@redhat.com>2023-11-11 00:41:09 +0000
commit7c02efd45f5e727ab8a1b397bce8817f4ab65954 (patch)
treec612c63956862c16d22b0e1005e7ac82e94ccc3a /libstdc++-v3/testsuite/26_numerics
parent0953497a81f1e320989b9f2aaa7f56747eddd4a0 (diff)
downloadgcc-7c02efd45f5e727ab8a1b397bce8817f4ab65954.zip
gcc-7c02efd45f5e727ab8a1b397bce8817f4ab65954.tar.gz
gcc-7c02efd45f5e727ab8a1b397bce8817f4ab65954.tar.bz2
libstdc++: Fix broken tests for <complex.h>
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 <complex.h> header and don't get <complex> via <bits/stdc++.h>. 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.
Diffstat (limited to 'libstdc++-v3/testsuite/26_numerics')
-rw-r--r--libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.cc (renamed from libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++11.h)4
-rw-r--r--libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.cc (renamed from libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_c++98.h)14
-rw-r--r--libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.cc (renamed from libstdc++-v3/testsuite/26_numerics/headers/complex.h/std_gnu++11.h)3
3 files changed, 13 insertions, 8 deletions
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
index f74b134..5cac121 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
// <http://www.gnu.org/licenses/>.
-// { dg-options "-std=c++11" }
+// { dg-do compile { target c++11 } }
+// { dg-add-options strict_std }
+// { dg-add-options no_pch }
#include <complex.h>
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
index 79facef8..4c9bd6e 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
// <http://www.gnu.org/licenses/>.
-// { dg-options "-std=c++98" }
+// { dg-do compile { target c++98_only } }
+// { dg-add-options strict_std }
+// { dg-add-options no_pch }
#include <complex.h>
-// Should be equivalent to C99 <complex>, not C++ <complex>
+// Should be equivalent to C99 <complex.h>, not C++ <complex>
+#ifndef complex
+# error "'complex' is not defined as a macro by <complex.h> 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 <complex.h> 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
index 20c55a5..4a6fc00 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
// <http://www.gnu.org/licenses/>.
-// { dg-options "-std=gnu++11" }
+// { dg-do compile { target c++11 } }
+// { dg-add-options no_pch }
#include <complex.h>