libstdc++: Require c++98_only effective target for some tests
authorJonathan Wakely <jwakely@redhat.com>
Thu, 2 Jul 2020 20:27:12 +0000 (21:27 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 2 Jul 2020 20:27:12 +0000 (21:27 +0100)
commitb857b179772951677cb12781f892454cd09d7831
treef5892fab903db777cc7185c41dfda865c0355e01
parent6b683144d1ef2cec32c829991fe122355341cd89
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.
22 files changed:
libstdc++-v3/testsuite/18_support/headers/cstdalign/std_c++0x_neg.cc
libstdc++-v3/testsuite/18_support/headers/cstdbool/std_c++0x_neg.cc
libstdc++-v3/testsuite/18_support/headers/cstdint/std_c++0x_neg.cc
libstdc++-v3/testsuite/18_support/headers/new/synopsis_cxx98.cc
libstdc++-v3/testsuite/19_diagnostics/headers/system_error/std_c++0x_neg.cc
libstdc++-v3/testsuite/20_util/headers/type_traits/std_c++0x_neg.cc
libstdc++-v3/testsuite/23_containers/headers/array/std_c++0x_neg.cc
libstdc++-v3/testsuite/23_containers/headers/tuple/std_c++0x_neg.cc
libstdc++-v3/testsuite/23_containers/headers/unordered_map/std_c++0x_neg.cc
libstdc++-v3/testsuite/23_containers/headers/unordered_set/std_c++0x_neg.cc
libstdc++-v3/testsuite/26_numerics/headers/ccomplex/std_c++0x_neg.cc
libstdc++-v3/testsuite/26_numerics/headers/cfenv/std_c++0x_neg.cc
libstdc++-v3/testsuite/26_numerics/headers/cmath/c99_classification_macros_c++98.cc
libstdc++-v3/testsuite/26_numerics/headers/ctgmath/std_c++0x_neg.cc
libstdc++-v3/testsuite/26_numerics/headers/random/std_c++0x_neg.cc
libstdc++-v3/testsuite/27_io/headers/cinttypes/std_c++0x_neg.cc
libstdc++-v3/testsuite/28_regex/headers/regex/std_c++0x_neg.cc
libstdc++-v3/testsuite/29_atomics/headers/atomic/std_c++0x_neg.cc
libstdc++-v3/testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc
libstdc++-v3/testsuite/30_threads/headers/future/std_c++0x_neg.cc
libstdc++-v3/testsuite/30_threads/headers/mutex/std_c++0x_neg.cc
libstdc++-v3/testsuite/30_threads/headers/thread/std_c++0x_neg.cc