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 +// REQUIRES: c++03 || c++11 // 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,8 @@ from libcxx.test.dsl import * -_allStandards = ['c++03', 'c++11', 'c++14', 'c++17', 'c++2a', 'c++2b'] +_allStandards = {'c++03': None, 'c++11': None, 'c++14': None, + 'c++17': 'c++1z', 'c++20': 'c++2a', 'c++2b': None} _warningFlags = [ '-Werror', '-Wall', @@ -38,13 +39,24 @@ '-Wno-unused-local-typedef', ] + +def getLatestStdFlag(cfg): + standards = sorted(_allStandards.items(), key=lambda sf: sf[0]) + for std, fallback in reversed(standards): + if hasCompileFlag(cfg, '-std='+std): + return (std, std) + if fallback and hasCompileFlag(cfg, '-std='+fallback): + return (std, fallback) + raise RuntimeError("The compiler doesn't seem to support any standard flag") + + DEFAULT_PARAMETERS = [ # Core parameters of the test suite - Parameter(name='std', choices=_allStandards, type=str, + Parameter(name='std', choices=list(_allStandards.keys()) + list(_allStandards.values()), 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)[1], actions=lambda std: [ - AddFeature(std), + AddFeature(next((s for s, f in reversed(_allStandards.items()) if f == std), std)), AddCompileFlag('-std={}'.format(std)), ]),