Index: libcxx/utils/libcxx/test/params.py =================================================================== --- libcxx/utils/libcxx/test/params.py +++ libcxx/utils/libcxx/test/params.py @@ -37,6 +37,19 @@ '-Wno-unused-local-typedef', ] +_allFreestandingActions = [ + AddFeature('libcpp-any-freestanding'), + AddCompileFlag('-D_LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE'), AddFeature('libcpp-has-no-global-filesystem-namespace'), + AddCompileFlag('-D_LIBCPP_HAS_NO_MONOTONIC_CLOCK'), AddFeature('libcpp-has-no-monotonic-clock'), + AddCompileFlag('-D_LIBCPP_HAS_NO_STDIN'), AddFeature('libcpp-has-no-stdin'), + AddCompileFlag('-D_LIBCPP_HAS_NO_STDOUT'), AddFeature('libcpp-has-no-stdout'), + AddCompileFlag('-D_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS'), AddFeature('libcpp-has-no-thread-unsafe-c-functions'), + AddCompileFlag('-D_LIBCPP_HAS_NO_THREADS'), AddFeature('libcpp-has-no-threads'), + AddCompileFlag('-D_LIBCPP_NO_VCRUNTIME'), AddFeature('libcpp-no-vcruntime'), + AddCompileFlag('-D_LIBCPP_HAS_NO_RANDOM_DEVICE'), AddFeature('libcpp-has-no-random-device'), + AddCompileFlag('-D_LIBCPP_HAS_NO_LOCALIZATION'), AddFeature('libcpp-has-no-localization'), +] + DEFAULT_PARAMETERS = [ # Core parameters of the test suite Parameter(name='std', choices=_allStandards, type=str, @@ -110,4 +123,7 @@ actions=lambda enabled: [] if enabled else [ AddFeature('libcxx-no-debug-mode') ]), + Parameter(name='freestanding', choices=[True, False], type=bool, default=False, + help="Whether to disable tests only supported on hosted platforms.", + actions=lambda enabled: [] if not enabled else _allFreestandingActions), ]