Skip to content

Commit 9328c1b

Browse files
committed
[libc++][test] Adds backdeployment shorthands.
Some changes in libc++ affect the dylib. These changes are not present on systems that use the system dylib. Currently that are the Apple backdeployment targets. Figuring out which MacOS versions to target is not trivial for non-Apple engineers. These shorthands make it easier to select the proper feature make a test UNSUPPORTED or XFAIL. During the design discussion with @ldionne we considered whether or not to add preprocessor definitions to allow partial disabling of a test. This would be useful when an existing feature is changed by modifying the dylib. In the end we decided not to add this feature to avoid additional complexity in the tests. Instead the test will be disabled for that target.
1 parent 5ca2777 commit 9328c1b

File tree

1 file changed

+97
-7
lines changed

1 file changed

+97
-7
lines changed

libcxx/utils/libcxx/test/features.py

Lines changed: 97 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -527,43 +527,124 @@ def check_gdb(cfg):
527527
# be achieved by creating a `.verify.cpp` test that checks for the right errors, and
528528
# mark that test as requiring `stdlib=<vendor>-libc++ && target=<target>`.
529529
DEFAULT_FEATURES += [
530+
# Backdeployment short-hands
531+
Feature(
532+
name="using-built-library-before-llvm-11",
533+
when=lambda cfg: BooleanExpression.evaluate(
534+
"stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0)(.0)?}}",
535+
cfg.available_features,
536+
)
537+
),
538+
Feature(
539+
name="using-built-library-before-llvm-12",
540+
when=lambda cfg: BooleanExpression.evaluate(
541+
"using-built-library-before-llvm-11 || (stdlib=apple-libc++ && target={{.+}}-apple-macosx12.{{(0|1|2)}}.0)",
542+
cfg.available_features,
543+
)
544+
),
545+
546+
Feature(
547+
name="using-built-library-before-llvm-13",
548+
when=lambda cfg: BooleanExpression.evaluate(
549+
"using-built-library-before-llvm-12 || (stdlib=apple-libc++ && target={{.+}}-apple-macosx{{((12.(3|4|5|6|7))|(13.(0|1|2|3)))}}.0)",
550+
cfg.available_features,
551+
)
552+
),
553+
554+
Feature(
555+
name="using-built-library-before-llvm-14",
556+
when=lambda cfg: BooleanExpression.evaluate(
557+
"using-built-library-before-llvm-13",
558+
cfg.available_features,
559+
)
560+
),
561+
562+
Feature(
563+
name="using-built-library-before-llvm-15",
564+
when=lambda cfg: BooleanExpression.evaluate(
565+
"using-built-library-before-llvm-14 || (stdlib=apple-libc++ && target={{.+}}-apple-macosx13.{{(4|5|6)}}.0)",
566+
cfg.available_features,
567+
)
568+
),
569+
570+
Feature(
571+
name="using-built-library-before-llvm-16",
572+
when=lambda cfg: BooleanExpression.evaluate(
573+
"using-built-library-before-llvm-15 || (stdlib=apple-libc++ && target={{.+}}-apple-macosx14.{{(0|1|2|3)}}.0)",
574+
cfg.available_features,
575+
)
576+
),
577+
578+
Feature(
579+
name="using-built-library-before-llvm-17",
580+
when=lambda cfg: BooleanExpression.evaluate(
581+
"using-built-library-before-llvm-16",
582+
cfg.available_features,
583+
)
584+
),
585+
586+
Feature(
587+
name="using-built-library-before-llvm-18",
588+
when=lambda cfg: BooleanExpression.evaluate(
589+
# For now, no released version of macOS contains LLVM 18
590+
# TODO(ldionne) Please provide the correct value.
591+
"using-built-library-before-llvm-17 || stdlib=apple-libc++ && target={{.+}}-apple-macosx{{.+}}",
592+
cfg.available_features,
593+
)
594+
),
595+
596+
Feature(
597+
name="using-built-library-before-llvm-19",
598+
when=lambda cfg: BooleanExpression.evaluate(
599+
# For now, no released version of macOS contains LLVM 19
600+
# TODO(ldionne) Please provide the correct value.
601+
"using-built-library-before-llvm-18 || stdlib=apple-libc++ && target={{.+}}-apple-macosx{{.+}}",
602+
cfg.available_features,
603+
)
604+
),
605+
530606
# Tests that require std::to_chars(floating-point) in the built library
531607
Feature(
532608
name="availability-fp_to_chars-missing",
533609
when=lambda cfg: BooleanExpression.evaluate(
534-
"stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}}",
610+
#"stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}}",
611+
"using-built-library-before-llvm-13",
535612
cfg.available_features,
536613
),
537614
),
538615
# Tests that require https://wg21.link/P0482 support in the built library
539616
Feature(
540617
name="availability-char8_t_support-missing",
541618
when=lambda cfg: BooleanExpression.evaluate(
542-
"stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0)(.0)?}}",
619+
#"stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0)(.0)?}}",
620+
"using-built-library-before-llvm-11",
543621
cfg.available_features,
544622
),
545623
),
546624
# Tests that require __libcpp_verbose_abort support in the built library
547625
Feature(
548626
name="availability-verbose_abort-missing",
549627
when=lambda cfg: BooleanExpression.evaluate(
550-
"stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}}",
628+
#"stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}}",
629+
"using-built-library-before-llvm-13",
551630
cfg.available_features,
552631
),
553632
),
554633
# Tests that require std::pmr support in the built library
555634
Feature(
556635
name="availability-pmr-missing",
557636
when=lambda cfg: BooleanExpression.evaluate(
558-
"stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}}",
637+
#"stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}}",
638+
"using-built-library-before-llvm-13",
559639
cfg.available_features,
560640
),
561641
),
562642
# Tests that require std::filesystem support in the built library
563643
Feature(
564644
name="availability-filesystem-missing",
565645
when=lambda cfg: BooleanExpression.evaluate(
566-
"stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{(13|14)(.0)?}}",
646+
#"stdlib=apple-libc++ && target={{.+}}-apple-macosx10.{{(13|14)(.0)?}}",
647+
"using-built-library-before-llvm-16",
567648
cfg.available_features,
568649
),
569650
),
@@ -579,8 +660,17 @@ def check_gdb(cfg):
579660
Feature(
580661
name="availability-tzdb-missing",
581662
when=lambda cfg: BooleanExpression.evaluate(
582-
# TODO(ldionne) Please provide the correct value.
583-
"(stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}})",
663+
#"(stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}})",
664+
"using-built-library-before-llvm-16",
665+
cfg.available_features,
666+
),
667+
),
668+
# Tests that require support for <print> and std::print in <ostream> in the built library.
669+
Feature(
670+
name="availability-print-missing",
671+
when=lambda cfg: BooleanExpression.evaluate(
672+
#"stdlib=apple-libc++ && target={{.+}}-apple-macosx{{(10.9|10.10|10.11|10.12|10.13|10.14|10.15|11.0|12.0|13.0)(.0)?}}",
673+
"using-built-library-before-llvm-18",
584674
cfg.available_features,
585675
),
586676
),

0 commit comments

Comments
 (0)