From 566f42273467817a31a7a1ae058ba759837eec22 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 31 Jul 2020 19:58:02 +0100 Subject: [PATCH] libstdc++: Use c++NN_only effective target to tests Some tests really are only intended for a specific -std mode, so add a target selector to make that explicit. Also reorder the dg-do directives to come after the dg-options ones, so that the target selector in the dg-do directive is applied after the dg-options that sets the -std option. libstdc++-v3/ChangeLog: * testsuite/20_util/reference_wrapper/83427.cc: Adjust effective-target to specific language mode only. * testsuite/24_iterators/headers/iterator/range_access_c++11.cc: Likewise. * testsuite/24_iterators/headers/iterator/range_access_c++14.cc: Likewise. * testsuite/24_iterators/headers/iterator/synopsis_c++11.cc: Likewise. * testsuite/24_iterators/headers/iterator/synopsis_c++14.cc: Likewise. * testsuite/26_numerics/valarray/69116.cc: Likewise. * testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc: Remove whitespace at end of file. * testsuite/30_threads/headers/future/std_c++0x_neg.cc: Likewise. --- libstdc++-v3/testsuite/20_util/reference_wrapper/83427.cc | 2 +- .../24_iterators/headers/iterator/range_access_c++11.cc | 2 +- .../24_iterators/headers/iterator/range_access_c++14.cc | 2 +- .../testsuite/24_iterators/headers/iterator/synopsis_c++11.cc | 2 +- .../testsuite/24_iterators/headers/iterator/synopsis_c++14.cc | 2 +- libstdc++-v3/testsuite/26_numerics/valarray/69116.cc | 2 +- .../30_threads/headers/condition_variable/std_c++0x_neg.cc | 3 --- .../testsuite/30_threads/headers/future/std_c++0x_neg.cc | 3 --- 8 files changed, 6 insertions(+), 12 deletions(-) diff --git a/libstdc++-v3/testsuite/20_util/reference_wrapper/83427.cc b/libstdc++-v3/testsuite/20_util/reference_wrapper/83427.cc index 3dbd0917621..613da848d72 100644 --- a/libstdc++-v3/testsuite/20_util/reference_wrapper/83427.cc +++ b/libstdc++-v3/testsuite/20_util/reference_wrapper/83427.cc @@ -16,7 +16,7 @@ // . // { dg-options "-std=gnu++17" } -// { dg-do compile { target c++17 } } +// { dg-do compile { target c++17_only } } #include diff --git a/libstdc++-v3/testsuite/24_iterators/headers/iterator/range_access_c++11.cc b/libstdc++-v3/testsuite/24_iterators/headers/iterator/range_access_c++11.cc index aed0ed45406..099288716e3 100644 --- a/libstdc++-v3/testsuite/24_iterators/headers/iterator/range_access_c++11.cc +++ b/libstdc++-v3/testsuite/24_iterators/headers/iterator/range_access_c++11.cc @@ -1,5 +1,5 @@ // { dg-options "-std=gnu++11" } -// { dg-do compile } +// { dg-do compile { target c++11_only } } // Copyright (C) 2010-2020 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/24_iterators/headers/iterator/range_access_c++14.cc b/libstdc++-v3/testsuite/24_iterators/headers/iterator/range_access_c++14.cc index 2523dc3d696..f5923386b79 100644 --- a/libstdc++-v3/testsuite/24_iterators/headers/iterator/range_access_c++14.cc +++ b/libstdc++-v3/testsuite/24_iterators/headers/iterator/range_access_c++14.cc @@ -1,5 +1,5 @@ // { dg-options "-std=gnu++14" } -// { dg-do compile } +// { dg-do compile { target c++14_only } } // Copyright (C) 2016-2020 Free Software Foundation, Inc. // diff --git a/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++11.cc b/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++11.cc index da7821e20ee..1fd115abd87 100644 --- a/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++11.cc +++ b/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++11.cc @@ -1,5 +1,5 @@ // { dg-options "-std=gnu++11" } -// { dg-do compile } +// { dg-do compile { target c++11_only } } // { dg-require-normal-namespace "" } // Copyright (C) 2016-2020 Free Software Foundation, Inc. diff --git a/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++14.cc b/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++14.cc index c2dd942f6e7..f296c852e76 100644 --- a/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++14.cc +++ b/libstdc++-v3/testsuite/24_iterators/headers/iterator/synopsis_c++14.cc @@ -1,5 +1,5 @@ // { dg-options "-std=gnu++14" } -// { dg-do compile } +// { dg-do compile { target c++14_only } } // { dg-require-normal-namespace "" } // Copyright (C) 2016-2020 Free Software Foundation, Inc. diff --git a/libstdc++-v3/testsuite/26_numerics/valarray/69116.cc b/libstdc++-v3/testsuite/26_numerics/valarray/69116.cc index 223dec3d11f..579c01cb37d 100644 --- a/libstdc++-v3/testsuite/26_numerics/valarray/69116.cc +++ b/libstdc++-v3/testsuite/26_numerics/valarray/69116.cc @@ -15,8 +15,8 @@ // with this library; see the file COPYING3. If not see // . -// { dg-do compile } // { dg-options "-std=gnu++98" } +// { dg-do compile { target c++98_only } } // libstdc++/69116 diff --git a/libstdc++-v3/testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc b/libstdc++-v3/testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc index 0b615988a77..45a0c74a9f7 100644 --- a/libstdc++-v3/testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc +++ b/libstdc++-v3/testsuite/30_threads/headers/condition_variable/std_c++0x_neg.cc @@ -21,6 +21,3 @@ #include // { dg-error "ISO C.. 2011" "" { target *-*-* } 32 } - - - diff --git a/libstdc++-v3/testsuite/30_threads/headers/future/std_c++0x_neg.cc b/libstdc++-v3/testsuite/30_threads/headers/future/std_c++0x_neg.cc index 22463f4bc55..c67214e4b21 100644 --- a/libstdc++-v3/testsuite/30_threads/headers/future/std_c++0x_neg.cc +++ b/libstdc++-v3/testsuite/30_threads/headers/future/std_c++0x_neg.cc @@ -21,6 +21,3 @@ #include // { dg-error "ISO C.. 2011" "" { target *-*-* } 32 } - - - -- 2.30.2