diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 98fdb1942b5fe..acdba36e7d48f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -370,6 +370,9 @@ if(NOT "${COVERAGE_DB}" STREQUAL "") COMMENT "Touching covering tests") endif() +include(CheckIncludeFileCXX) +check_include_file_cxx("span" HAVE_STD_SPAN) + foreach(SDK ${SWIFT_SDKS}) foreach(ARCH ${SWIFT_SDK_${SDK}_ARCHITECTURES}) # macCatalyst needs to run two sets of tests: one with the normal macosx target triple diff --git a/test/Interop/Cxx/class/access/swiftify-private-fileid.swift b/test/Interop/Cxx/class/access/swiftify-private-fileid.swift index 948f935554d1f..8944779e6fc96 100644 --- a/test/Interop/Cxx/class/access/swiftify-private-fileid.swift +++ b/test/Interop/Cxx/class/access/swiftify-private-fileid.swift @@ -1,11 +1,10 @@ -// REQUIRES: rdar162106643 - // RUN: rm -rf %t // RUN: split-file %s %t // RUN: %target-swift-frontend -emit-ir -I %swift_src_root/lib/ClangImporter/SwiftBridging -plugin-path %swift-plugin-dir %t/blessed.swift -module-name main -I %t/Inputs -o %t/out -Xcc -std=c++20 -cxx-interoperability-mode=default -enable-experimental-feature SafeInteropWrappers -verify // REQUIRES: swift_feature_SafeInteropWrappers +// REQUIRES: std_span //--- Inputs/swiftify-non-public.h #pragma once diff --git a/test/Interop/Cxx/class/safe-interop-mode.swift b/test/Interop/Cxx/class/safe-interop-mode.swift index 2b9187a7a263e..e6ee9c161c8a4 100644 --- a/test/Interop/Cxx/class/safe-interop-mode.swift +++ b/test/Interop/Cxx/class/safe-interop-mode.swift @@ -5,6 +5,7 @@ // REQUIRES: objc_interop // REQUIRES: swift_feature_LifetimeDependence +// REQUIRES: std_span //--- Inputs/module.modulemap module Test { diff --git a/test/Interop/Cxx/stdlib/std-span-interface.swift b/test/Interop/Cxx/stdlib/std-span-interface.swift index c2f4b2de098c6..2a5691421a19b 100644 --- a/test/Interop/Cxx/stdlib/std-span-interface.swift +++ b/test/Interop/Cxx/stdlib/std-span-interface.swift @@ -7,7 +7,7 @@ // REQUIRES: swift_feature_SafeInteropWrappers // REQUIRES: swift_feature_Lifetimes -// REQUIRES: rdar161999174 +// REQUIRES: std_span #if !BRIDGING_HEADER import StdSpan diff --git a/test/Interop/Cxx/stdlib/std-span-transformed-execution.swift b/test/Interop/Cxx/stdlib/std-span-transformed-execution.swift index 1b22a53f8e671..7c04a7293e671 100644 --- a/test/Interop/Cxx/stdlib/std-span-transformed-execution.swift +++ b/test/Interop/Cxx/stdlib/std-span-transformed-execution.swift @@ -1,5 +1,3 @@ -// REQUIRES: rdar162106653 - // RUN: %target-run-simple-swift(-plugin-path %swift-plugin-dir -I %S/Inputs -Xfrontend -enable-experimental-cxx-interop -swift-version 6 -Xfrontend -disable-availability-checking -Xcc -std=c++20 -enable-experimental-feature LifetimeDependence -enable-experimental-feature SafeInteropWrappers) // TODO: test failed in Windows PR testing: rdar://144384453 @@ -9,6 +7,7 @@ // REQUIRES: swift_feature_LifetimeDependence // REQUIRES: executable_test +// REQUIRES: std_span #if !BRIDGING_HEADER import StdSpan diff --git a/test/Interop/Cxx/stdlib/use-std-span-typechecker.swift b/test/Interop/Cxx/stdlib/use-std-span-typechecker.swift index ba5d494ad0955..0a77811ba0905 100644 --- a/test/Interop/Cxx/stdlib/use-std-span-typechecker.swift +++ b/test/Interop/Cxx/stdlib/use-std-span-typechecker.swift @@ -1,6 +1,5 @@ -// REQUIRES: rdar162106722 - // RUN: %target-typecheck-verify-swift -I %S/Inputs -enable-experimental-cxx-interop -Xcc -std=c++20 2>&1 +// REQUIRES: std_span import StdSpan diff --git a/test/Interop/Cxx/stdlib/use-std-span.swift b/test/Interop/Cxx/stdlib/use-std-span.swift index 37a817c027cfa..d9302da7d43b1 100644 --- a/test/Interop/Cxx/stdlib/use-std-span.swift +++ b/test/Interop/Cxx/stdlib/use-std-span.swift @@ -1,5 +1,3 @@ -// REQUIRES: rdar162106580 - // RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop -Xcc -std=c++20) // RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop -Xcc -std=c++20 -Xcc -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG) @@ -7,6 +5,7 @@ // UNSUPPORTED: OS=windows-msvc // REQUIRES: executable_test +// REQUIRES: std_span import StdlibUnittest #if !BRIDGING_HEADER diff --git a/test/Interop/Cxx/swiftify-import/import-as-instance-method.swift b/test/Interop/Cxx/swiftify-import/import-as-instance-method.swift index c2e9d579bab79..c1779a087ce18 100644 --- a/test/Interop/Cxx/swiftify-import/import-as-instance-method.swift +++ b/test/Interop/Cxx/swiftify-import/import-as-instance-method.swift @@ -1,6 +1,5 @@ -// REQUIRES: rdar162106619 - // REQUIRES: swift_feature_SafeInteropWrappers +// REQUIRES: std_span // RUN: %empty-directory(%t) // RUN: split-file %s %t diff --git a/test/Interop/Cxx/swiftify-import/span-in-ctor.swift b/test/Interop/Cxx/swiftify-import/span-in-ctor.swift index e09bcdd2a276f..348258acdfd0f 100644 --- a/test/Interop/Cxx/swiftify-import/span-in-ctor.swift +++ b/test/Interop/Cxx/swiftify-import/span-in-ctor.swift @@ -1,6 +1,5 @@ -// REQUIRES: rdar162106747 - // REQUIRES: swift_feature_SafeInteropWrappers +// REQUIRES: std_span // RUN: rm -rf %t // RUN: split-file %s %t diff --git a/test/Interop/CxxToSwiftToCxx/span/span-execution.cpp b/test/Interop/CxxToSwiftToCxx/span/span-execution.cpp index 839e89ba38eb6..192b386fb3619 100644 --- a/test/Interop/CxxToSwiftToCxx/span/span-execution.cpp +++ b/test/Interop/CxxToSwiftToCxx/span/span-execution.cpp @@ -10,10 +10,10 @@ // RUN: %target-run %t/swift-cxx-execution | %FileCheck %s // REQUIRES: executable_test - -// REQUIRES: OS=macosx || rdar-161999258 +// REQUIRES: std_span //--- header.h +#include #include #include diff --git a/test/Macros/SwiftifyImport/CxxSpan/LifetimeboundSpan.swift b/test/Macros/SwiftifyImport/CxxSpan/LifetimeboundSpan.swift index 37c4761fa39f1..9b091d101f6cd 100644 --- a/test/Macros/SwiftifyImport/CxxSpan/LifetimeboundSpan.swift +++ b/test/Macros/SwiftifyImport/CxxSpan/LifetimeboundSpan.swift @@ -3,8 +3,7 @@ // RUN: %target-swift-frontend %s -enable-experimental-cxx-interop -I %S/Inputs -Xcc -std=c++20 -swift-version 5 -module-name main -disable-availability-checking -typecheck -plugin-path %swift-plugin-dir -dump-macro-expansions -verify -strict-memory-safety 2>&1 | %FileCheck --match-full-lines %s -// FIXME swift-ci linux tests do not support std::span -// UNSUPPORTED: OS=linux-gnu +// REQUIRES: std_span import CxxStdlib import StdSpan diff --git a/test/Macros/SwiftifyImport/CxxSpan/NoEscapeSpan.swift b/test/Macros/SwiftifyImport/CxxSpan/NoEscapeSpan.swift index bd9e9451217be..246a61a1eaafa 100644 --- a/test/Macros/SwiftifyImport/CxxSpan/NoEscapeSpan.swift +++ b/test/Macros/SwiftifyImport/CxxSpan/NoEscapeSpan.swift @@ -3,8 +3,7 @@ // RUN: %target-swift-frontend %s -cxx-interoperability-mode=default -I %S/Inputs -Xcc -std=c++20 -swift-version 5 -module-name main -disable-availability-checking -typecheck -enable-experimental-feature Lifetimes -plugin-path %swift-plugin-dir -strict-memory-safety -warnings-as-errors -dump-macro-expansions 2>&1 | %FileCheck --match-full-lines %s -// FIXME swift-ci linux tests do not support std::span -// UNSUPPORTED: OS=linux-gnu +// REQUIRES: std_span import CxxStdlib import StdSpan diff --git a/test/SourceKit/InterfaceGen/gen_clang_cxx_module_with_cxx20.swift b/test/SourceKit/InterfaceGen/gen_clang_cxx_module_with_cxx20.swift index dc0758966dfc0..443f9bda02f5c 100644 --- a/test/SourceKit/InterfaceGen/gen_clang_cxx_module_with_cxx20.swift +++ b/test/SourceKit/InterfaceGen/gen_clang_cxx_module_with_cxx20.swift @@ -4,7 +4,6 @@ // Now make sure we emit the correct interface for std::span if C++20 is enabled. // RUN: %sourcekitd-test -req=interface-gen -module UsesCXX20 -- -cxx-interoperability-mode=default -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import -I %S/Inputs -target %target-triple -sdk %sdk -Xcc -std=c++20 | %FileCheck %s -// FIXME: older libstdc++ version on Swift CI does not support C++20 -// UNSUPPORTED: OS=linux-gnu +// REQUIRES: std_span // CHECK: public typealias MySpanOfInt = std.span< diff --git a/test/lit.site.cfg.in b/test/lit.site.cfg.in index 4da78ee4d43ec..d1ea2880b3551 100644 --- a/test/lit.site.cfg.in +++ b/test/lit.site.cfg.in @@ -182,3 +182,6 @@ if config.test_exec_root is None: lit_config.load_config(config, os.path.join(config.test_exec_root, "lit.swift-features.cfg")) lit_config.load_config( config, os.path.join(config.swift_src_root, "test", "lit.cfg")) + +if '@HAVE_STD_SPAN@' == '1': + config.available_features.add('std_span')