diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array11.pass.cpp @@ -11,7 +11,7 @@ // Note that sized delete operator definitions below are simply ignored // when sized deallocation is not supported, e.g., prior to C++14. -// UNSUPPORTED: c++14, c++17, c++2a +// UNSUPPORTED: c++14, c++17, c++20 // UNSUPPORTED: sanitizer-new-delete #include diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp --- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp +++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete11.pass.cpp @@ -11,7 +11,7 @@ // Note that sized delete operator definitions below are simply ignored // when sized deallocation is not supported, e.g., prior to C++14. -// UNSUPPORTED: c++14, c++17, c++2a +// REQUIRES: c++03 || c++11 // UNSUPPORTED: sanitizer-new-delete #include diff --git a/libcxx/test/std/strings/basic.string/string.contains/contains.char.pass.cpp b/libcxx/test/std/strings/basic.string/string.contains/contains.char.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.contains/contains.char.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.contains/contains.char.pass.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // diff --git a/libcxx/test/std/strings/basic.string/string.contains/contains.ptr.pass.cpp b/libcxx/test/std/strings/basic.string/string.contains/contains.ptr.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.contains/contains.ptr.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.contains/contains.ptr.pass.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // diff --git a/libcxx/test/std/strings/basic.string/string.contains/contains.string_view.pass.cpp b/libcxx/test/std/strings/basic.string/string.contains/contains.string_view.pass.cpp --- a/libcxx/test/std/strings/basic.string/string.contains/contains.string_view.pass.cpp +++ b/libcxx/test/std/strings/basic.string/string.contains/contains.string_view.pass.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // diff --git a/libcxx/test/std/strings/string.view/string.view.template/contains.char.pass.cpp b/libcxx/test/std/strings/string.view/string.view.template/contains.char.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.template/contains.char.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.template/contains.char.pass.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // diff --git a/libcxx/test/std/strings/string.view/string.view.template/contains.ptr.pass.cpp b/libcxx/test/std/strings/string.view/string.view.template/contains.ptr.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.template/contains.ptr.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.template/contains.ptr.pass.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // diff --git a/libcxx/test/std/strings/string.view/string.view.template/contains.string_view.pass.cpp b/libcxx/test/std/strings/string.view/string.view.template/contains.string_view.pass.cpp --- a/libcxx/test/std/strings/string.view/string.view.template/contains.string_view.pass.cpp +++ b/libcxx/test/std/strings/string.view/string.view.template/contains.string_view.pass.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_scoped_enum.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_scoped_enum.pass.cpp --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_scoped_enum.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_scoped_enum.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // type_traits diff --git a/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.pass.cpp b/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.pass.cpp --- a/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.pass.cpp +++ b/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.pass.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // [utility.underlying], to_underlying // template diff --git a/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp b/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp --- a/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp +++ b/libcxx/test/std/utilities/utility/utility.underlying/to_underlying.verify.cpp @@ -6,7 +6,7 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03, c++11, c++14, c++17, c++2a +// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20 // [utility.underlying], to_underlying // template diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py --- a/libcxx/utils/libcxx/test/params.py +++ b/libcxx/utils/libcxx/test/params.py @@ -8,7 +8,10 @@ from libcxx.test.dsl import * -_allStandards = ['c++03', 'c++11', 'c++14', 'c++17', 'c++2a', 'c++2b'] +_allStandards = ['c++03', 'c++11', 'c++14', 'c++17', 'c++20', 'c++2b'] +_standardFallback = {'c++11': 'c++0x', 'c++14': 'c++1y', 'c++17': 'c++1z', 'c++20': 'c++2a'} +_undoStandardFallback = dict((v, k) for k, v in _standardFallback.items()) +_allStandardsAndFallbacks = _allStandards + list(_standardFallback.values()) _warningFlags = [ '-Werror', '-Wall', @@ -38,13 +41,25 @@ '-Wno-unused-local-typedef', ] + +def getLatestStdFlag(cfg): + for s in reversed(_allStandards): + if hasCompileFlag(cfg, '-std='+s): + return s + if s in _standardFallback: + fs = _standardFallback[s] + if hasCompileFlag(cfg, '-std='+fs): + return fs + return _allStandards[0] + + DEFAULT_PARAMETERS = [ # Core parameters of the test suite - Parameter(name='std', choices=_allStandards, type=str, + Parameter(name='std', choices=_allStandardsAndFallbacks, type=str, help="The version of the standard to compile the test suite with.", - default=lambda cfg: next(s for s in reversed(_allStandards) if hasCompileFlag(cfg, '-std='+s)), + default=lambda cfg: getLatestStdFlag(cfg), actions=lambda std: [ - AddFeature(std), + AddFeature(_undoStandardFallback[std] if std in _undoStandardFallback else std), AddCompileFlag('-std={}'.format(std)), ]),