libstdc++: Require c++98_only effective target for some tests

These tests verify that including C++11 headers fails to compile in
C++98 mode. They use { dg-options "-std=gnu++98" } so that they are
explicitly run in C++98 mode. This change also adds a target selector so
that the tests will be skipped even if the dg-options directive is
filtered out or overridden. This is in preparation for a desired future
change where tests do not use -std options, so that they can be tested
with e.g. --target_board=unix\"{-std=gnu++17,-std=gnu++20}\"

In some cases the dg-options and dg-do directives need to be reordered,
so that the -std=gnu++98 option is already added to the options before
the target selector is checked.

libstdc++-v3/ChangeLog:

	* testsuite/18_support/headers/cstdalign/std_c++0x_neg.cc: Add
	c++98_only target selector.
	* testsuite/18_support/headers/cstdbool/std_c++0x_neg.cc:
	Likewise.
	* testsuite/18_support/headers/cstdint/std_c++0x_neg.cc:
	Likewise.
	* testsuite/18_support/headers/new/synopsis_cxx98.cc: Likewise.
	* testsuite/19_diagnostics/headers/system_error/std_c++0x_neg.cc:
	Likewise.
	* testsuite/20_util/headers/type_traits/std_c++0x_neg.cc:
	Likewise.
	* testsuite/23_containers/headers/array/std_c++0x_neg.cc:
	Likewise.
	* testsuite/23_containers/headers/tuple/std_c++0x_neg.cc:
	Likewise.
	* testsuite/23_containers/headers/unordered_map/std_c++0x_neg.cc:
	Likewise.
	* testsuite/23_containers/headers/unordered_set/std_c++0x_neg.cc:
	Likewise.
	* testsuite/26_numerics/headers/ccomplex/std_c++0x_neg.cc:
	Likewise.
	* testsuite/26_numerics/headers/cfenv/std_c++0x_neg.cc:
	Likewise.
	* testsuite/26_numerics/headers/cmath/c99_classification_macros_c++98.cc:
	Likewise.
	* testsuite/26_numerics/headers/ctgmath/std_c++0x_neg.cc:
	Likewise.
	* testsuite/26_numerics/headers/random/std_c++0x_neg.cc:
	Likewise.
	* testsuite/27_io/headers/cinttypes/std_c++0x_neg.cc: Likewise.
	* testsuite/28_regex/headers/regex/std_c++0x_neg.cc: Likewise.
	* testsuite/29_atomics/headers/atomic/std_c++0x_neg.cc:
	Likewise.
	* testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc:
	Likewise.
	* testsuite/30_threads/headers/future/std_c++0x_neg.cc:
	Likewise.
	* testsuite/30_threads/headers/mutex/std_c++0x_neg.cc: Likewise.
	* testsuite/30_threads/headers/thread/std_c++0x_neg.cc:
	Likewise.
This commit is contained in:
Jonathan Wakely 2020-07-02 21:27:12 +01:00
parent 6b683144d1
commit b857b17977
22 changed files with 23 additions and 23 deletions

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2011-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-options "-std=gnu++98" }
// { dg-do compile }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -18,7 +18,7 @@
// <http://www.gnu.org/licenses/>.
// { dg-options "-std=gnu++98" }
// { dg-do compile }
// { dg-do compile { target c++98_only } }
// { dg-excess-errors "" { target uclibc } }
#include <cmath>
@ -55,7 +55,7 @@ template <typename _Tp>
fp_type f1 = 1.0;
fp_type f2 = 3.0;
int res = 0;
res = std::fpclassify(f1);
res = std::isfinite(f2);
res = std::isinf(f1);

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2007-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2008-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2008-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2009-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// Copyright (C) 2008-2020 Free Software Foundation, Inc.
//

View File

@ -1,5 +1,5 @@
// { dg-do compile }
// { dg-options "-std=gnu++98" }
// { dg-do compile { target c++98_only } }
// { dg-require-gthreads "" }
// Copyright (C) 2008-2020 Free Software Foundation, Inc.