From 62d556eceeeaee2db73f4ce47bfdcaafb55c5270 Mon Sep 17 00:00:00 2001 From: Florian Mayer Date: Tue, 18 Nov 2025 16:05:43 -0800 Subject: [PATCH] [NFC] [test] [libcxx] Fix invalid escape sequences ``` >>> "_target-has-llvm-21 || target={{.+}}-apple-macosx{{26.[0-9](.\d+)?}}" == r"_target-has-llvm-21 || target={{.+}}-apple-macosx{{26.[0-9](.\\ d+)?}}" :1: SyntaxWarning: invalid escape sequence '\d' True >>> "_target-has-llvm-20 || target={{.+}}-apple-macosx{{15.[4-9](.\d+)?}}" == r"_target-has-llvm-20 || target={{.+}}-apple-macosx{{15.[4-9](.\\ d+)?}}" :1: SyntaxWarning: invalid escape sequence '\d' True >>> "_target-has-llvm-19 || target={{.+}}-apple-macosx{{15.[0-3](.\d+)?}}" == r"_target-has-llvm-19 || target={{.+}}-apple-macosx{{15.[0-3](.\\ d+)?}}" :1: SyntaxWarning: invalid escape sequence '\d' True >>> "_target-has-llvm-18 || target={{.+}}-apple-macosx{{14.[4-9](.\d+)?}}" == r"_target-has-llvm-18 || target={{.+}}-apple-macosx{{14.[4-9](.\\ d+)?}}" :1: SyntaxWarning: invalid escape sequence '\d' ``` --- libcxx/utils/libcxx/test/features/availability.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libcxx/utils/libcxx/test/features/availability.py b/libcxx/utils/libcxx/test/features/availability.py index c312a7cf830ed..39c6cf45a1708 100644 --- a/libcxx/utils/libcxx/test/features/availability.py +++ b/libcxx/utils/libcxx/test/features/availability.py @@ -29,28 +29,28 @@ Feature( name="_target-has-llvm-20", when=lambda cfg: BooleanExpression.evaluate( - "_target-has-llvm-21 || target={{.+}}-apple-macosx{{26.[0-9](.\d+)?}}", + r"_target-has-llvm-21 || target={{.+}}-apple-macosx{{26.[0-9](.\d+)?}}", cfg.available_features, ), ), Feature( name="_target-has-llvm-19", when=lambda cfg: BooleanExpression.evaluate( - "_target-has-llvm-20 || target={{.+}}-apple-macosx{{15.[4-9](.\d+)?}}", + r"_target-has-llvm-20 || target={{.+}}-apple-macosx{{15.[4-9](.\d+)?}}", cfg.available_features, ), ), Feature( name="_target-has-llvm-18", when=lambda cfg: BooleanExpression.evaluate( - "_target-has-llvm-19 || target={{.+}}-apple-macosx{{15.[0-3](.\d+)?}}", + r"_target-has-llvm-19 || target={{.+}}-apple-macosx{{15.[0-3](.\d+)?}}", cfg.available_features, ), ), Feature( name="_target-has-llvm-17", when=lambda cfg: BooleanExpression.evaluate( - "_target-has-llvm-18 || target={{.+}}-apple-macosx{{14.[4-9](.\d+)?}}", + r"_target-has-llvm-18 || target={{.+}}-apple-macosx{{14.[4-9](.\d+)?}}", cfg.available_features, ), ),