Skip to content

Commit 96cd69b

Browse files
committed
[RFC][libc++][test] Improves C++ Standard filtering.
This is a proof-of-concept how we could improve the C++ language filtering in lit. There will be a Discourse post for adding feedback on the approach.
1 parent a4422a5 commit 96cd69b

File tree

8 files changed

+27
-9
lines changed

8 files changed

+27
-9
lines changed

libcxx/test/std/input.output/iostream.format/print.fun/includes.compile.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
//===----------------------------------------------------------------------===//
77

8-
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
8+
// REQUIRES: >=c++23
99
// UNSUPPORTED: no-filesystem
1010
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
1111

libcxx/test/std/input.output/iostream.format/print.fun/no_file_description.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
//===----------------------------------------------------------------------===//
77

8-
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++20
8+
// UNSUPPORTED: <=c++20
99
// UNSUPPORTED: no-filesystem
1010
// UNSUPPORTED: GCC-ALWAYS_INLINE-FIXME
1111

libcxx/test/std/localization/locale.stdcvt/depr.verify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// UNSUPPORTED: c++03, c++11, c++14, c++26
9+
// UNSUPPORTED: <=c++14, >=c++26
1010
// UNSUPPORTED: no-wide-characters
1111

1212
// <codecvt>

libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/depr.verify.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// UNSUPPORTED: c++03, c++11, c++14, c++26
9+
// REQUIRES: >=c++17
10+
// UNSUPPORTED: >=c++26
1011

1112
// XFAIL: no-wide-characters
1213

libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.string/depr.verify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_ENABLE_CXX26_REMOVED_WSTRING_CONVERT
1010

11-
// UNSUPPORTED: c++03, c++11, c++14, c++26
11+
// UNSUPPORTED: <=c++14, >=c++26
1212
// UNSUPPORTED: no-wide-characters
1313

1414
// <codecvt>

libcxx/test/std/strings/basic.string/string.capacity/reserve.deprecated_in_cxx20.verify.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// void reserve(); // Deprecated in C++20
1212

13-
// UNSUPPORTED: c++03, c++11, c++14, c++17, c++26
13+
// UNSUPPORTED: <=c++17, >=c++26
1414

1515
#include <string>
1616

libcxx/utils/libcxx/test/params.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,28 @@ def getSuitableClangTidy(cfg):
165165
default=lambda cfg: next(
166166
s for s in reversed(_allStandards) if getStdFlag(cfg, s)
167167
),
168-
actions=lambda std: [
168+
actions=lambda std: filter(None, [
169169
AddFeature(std),
170+
171+
AddFeature("<=c++03") if std <= "c++03" else None,
172+
AddFeature("<=c++11") if std <= "c++11" else None,
173+
AddFeature("<=c++14") if std <= "c++14" else None,
174+
AddFeature("<=c++17") if std <= "c++17" else None,
175+
AddFeature("<=c++20") if std <= "c++20" else None,
176+
AddFeature("<=c++23") if std <= "c++23" else None,
177+
AddFeature("<=c++26") if std <= "c++26" else None,
178+
179+
AddFeature(">=c++03") if std >= "c++03" else None,
180+
AddFeature(">=c++11") if std >= "c++11" else None,
181+
AddFeature(">=c++14") if std >= "c++14" else None,
182+
AddFeature(">=c++17") if std >= "c++17" else None,
183+
AddFeature(">=c++20") if std >= "c++20" else None,
184+
AddFeature(">=c++23") if std >= "c++23" else None,
185+
AddFeature(">=c++26") if std >= "c++26" else None,
186+
170187
AddSubstitution("%{cxx_std}", re.sub(r"\+", "x", std)),
171188
AddCompileFlag(lambda cfg: getStdFlag(cfg, std)),
172-
],
189+
]),
173190
),
174191
Parameter(
175192
name="optimization",

llvm/utils/lit/lit/BooleanExpression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def __init__(self, string, variables):
4747

4848
# Tokenization pattern.
4949
Pattern = re.compile(
50-
r"\A\s*([()]|&&|\|\||!|(?:[-+=._a-zA-Z0-9]+|\{\{.+?\}\})+)\s*(.*)\Z"
50+
r"\A\s*([()]|&&|\|\||!|(?:[-+<=>._a-zA-Z0-9]+|\{\{.+?\}\})+)\s*(.*)\Z"
5151
)
5252

5353
@staticmethod

0 commit comments

Comments
 (0)