mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
A previous PR already added support to the SwiftifyImport macro to generate safe wrappers. This PR makes ClangImporter emit the macro to do the transformation.
18 lines
745 B
Swift
18 lines
745 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-ide-test -plugin-path %swift-plugin-dir -I %S/Inputs -enable-experimental-feature Span -enable-experimental-feature SafeInteropWrappers -print-module -module-to-print=StdSpan -source-filename=x -enable-experimental-cxx-interop -Xcc -std=c++20 -module-cache-path %t > %t/interface.swift
|
|
// RUN: %FileCheck %s < %t/interface.swift
|
|
|
|
// REQUIRES: swift_feature_SafeInteropWrappers
|
|
// REQUIRES: swift_feature_Span
|
|
|
|
// FIXME swift-ci linux tests do not support std::span
|
|
// UNSUPPORTED: OS=linux-gnu
|
|
|
|
#if !BRIDGING_HEADER
|
|
import StdSpan
|
|
#endif
|
|
import CxxStdlib
|
|
|
|
// CHECK: func funcWithSafeWrapper(_ s: SpanOfInt)
|
|
// CHECK-NEXT: @_alwaysEmitIntoClient public func funcWithSafeWrapper(_ s: Span<CInt>)
|