Skip to content

Commit d00f711

Browse files
authored
Merge pull request #84755 from hnrklssn/cherry-pick-swiftify-import-as-method-6.2
Cherry-pick [6.2] [Swiftify] Add support for free functions imported as instance methods
2 parents bf26715 + d1dbf8e commit d00f711

File tree

14 files changed

+500
-32
lines changed

14 files changed

+500
-32
lines changed

include/swift/AST/DiagnosticsClangImporter.def

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ GROUPED_WARNING(clang_ignored_sendable_attr, ClangDeclarationImport, none,
100100
"cannot be added to it",
101101
(Type))
102102

103+
GROUPED_WARNING(warn_clang_ignored_bounds_on_self, ClangDeclarationImport, none,
104+
"bounds attribute '%0' ignored on parameter mapped to 'self'",
105+
(StringRef))
106+
NOTE(note_swift_name_instance_method, none,
107+
"swift_name maps free function to instance method here", ())
108+
103109
WARNING(implicit_bridging_header_imported_from_module,none,
104110
"implicit import of bridging header '%0' via module %1 "
105111
"is deprecated and will be removed in a later version of Swift",

lib/ClangImporter/ImportDecl.cpp

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9403,6 +9403,22 @@ void ClangImporter::Implementation::addOptionSetTypealiases(
94039403
selfType);
94049404
}
94059405

9406+
// until CountAttributedType::getAttributeName lands in our LLVM branch
9407+
static StringRef getAttributeName(const clang::CountAttributedType *CAT) {
9408+
switch (CAT->getKind()) {
9409+
case clang::CountAttributedType::CountedBy:
9410+
return "__counted_by";
9411+
case clang::CountAttributedType::CountedByOrNull:
9412+
return "__counted_by_or_null";
9413+
case clang::CountAttributedType::SizedBy:
9414+
return "__sized_by";
9415+
case clang::CountAttributedType::SizedByOrNull:
9416+
return "__sized_by_or_null";
9417+
case clang::CountAttributedType::EndedBy:
9418+
llvm_unreachable("CountAttributedType cannot be ended_by");
9419+
}
9420+
}
9421+
94069422
void ClangImporter::Implementation::swiftify(AbstractFunctionDecl *MappedDecl) {
94079423
if (!SwiftContext.LangOpts.hasFeature(Feature::SafeInteropWrappers))
94089424
return;
@@ -9419,9 +9435,6 @@ void ClangImporter::Implementation::swiftify(AbstractFunctionDecl *MappedDecl) {
94199435
ClangDecl->getAccess() == clang::AS_private)
94209436
return;
94219437

9422-
if (ClangDecl->getNumParams() != MappedDecl->getParameters()->size())
9423-
return;
9424-
94259438
MacroDecl *SwiftifyImportDecl = dyn_cast_or_null<MacroDecl>(getKnownSingleDecl(SwiftContext, "_SwiftifyImport"));
94269439
if (!SwiftifyImportDecl)
94279440
return;
@@ -9478,14 +9491,44 @@ void ClangImporter::Implementation::swiftify(AbstractFunctionDecl *MappedDecl) {
94789491
true);
94799492
returnHasLifetimeInfo = true;
94809493
}
9494+
9495+
bool isClangInstanceMethod =
9496+
isa<clang::CXXMethodDecl>(ClangDecl) &&
9497+
!isa<clang::CXXConstructorDecl>(ClangDecl) &&
9498+
cast<clang::CXXMethodDecl>(ClangDecl)->isInstance();
9499+
size_t swiftNumParams = MappedDecl->getParameters()->size() -
9500+
(ClangDecl->isVariadic() ? 1 : 0);
9501+
ASSERT((MappedDecl->isImportAsInstanceMember() == isClangInstanceMethod) ==
9502+
(ClangDecl->getNumParams() == swiftNumParams));
9503+
9504+
size_t selfParamIndex = MappedDecl->isImportAsInstanceMember()
9505+
? MappedDecl->getSelfIndex()
9506+
: ClangDecl->getNumParams();
94819507
for (auto [index, clangParam] : llvm::enumerate(ClangDecl->parameters())) {
94829508
auto clangParamTy = clangParam->getType();
9483-
auto swiftParam = MappedDecl->getParameters()->get(index);
9509+
int mappedIndex = index < selfParamIndex ? index :
9510+
index > selfParamIndex ? index - 1 :
9511+
SwiftifyInfoPrinter::SELF_PARAM_INDEX;
9512+
ParamDecl *swiftParam = nullptr;
9513+
if (mappedIndex == SwiftifyInfoPrinter::SELF_PARAM_INDEX) {
9514+
swiftParam = MappedDecl->getImplicitSelfDecl(/*createIfNeeded*/true);
9515+
} else {
9516+
swiftParam = MappedDecl->getParameters()->get(mappedIndex);
9517+
}
9518+
ASSERT(swiftParam);
94849519
Type swiftParamTy = swiftParam->getInterfaceType();
94859520
bool paramHasBoundsInfo = false;
94869521
auto *CAT = clangParamTy->getAs<clang::CountAttributedType>();
9487-
if (SwiftifiableCAT(getClangASTContext(), CAT, swiftParamTy)) {
9488-
printer.printCountedBy(CAT, index);
9522+
if (CAT && mappedIndex == SwiftifyInfoPrinter::SELF_PARAM_INDEX) {
9523+
diagnose(HeaderLoc(clangParam->getLocation()),
9524+
diag::warn_clang_ignored_bounds_on_self, getAttributeName(CAT));
9525+
auto swiftName = ClangDecl->getAttr<clang::SwiftNameAttr>();
9526+
ASSERT(swiftName &&
9527+
"free function mapped to instance method without swift_name??");
9528+
diagnose(HeaderLoc(swiftName->getLocation()),
9529+
diag::note_swift_name_instance_method);
9530+
} else if (SwiftifiableCAT(getClangASTContext(), CAT, swiftParamTy)) {
9531+
printer.printCountedBy(CAT, mappedIndex);
94899532
attachMacro = paramHasBoundsInfo = true;
94909533
}
94919534
bool paramIsStdSpan = registerStdSpanTypeMapping(
@@ -9494,14 +9537,16 @@ void ClangImporter::Implementation::swiftify(AbstractFunctionDecl *MappedDecl) {
94949537

94959538
bool paramHasLifetimeInfo = false;
94969539
if (clangParam->hasAttr<clang::NoEscapeAttr>()) {
9497-
printer.printNonEscaping(index);
9540+
printer.printNonEscaping(mappedIndex);
94989541
paramHasLifetimeInfo = true;
94999542
}
95009543
if (clangParam->hasAttr<clang::LifetimeBoundAttr>()) {
95019544
// If this parameter has bounds info we will tranform it into a Span,
95029545
// so then it will no longer be Escapable.
9503-
bool willBeEscapable = swiftParamTy->isEscapable() && !paramHasBoundsInfo;
9504-
printer.printLifetimeboundReturn(index, willBeEscapable);
9546+
bool willBeEscapable = swiftParamTy->isEscapable() &&
9547+
(!paramHasBoundsInfo ||
9548+
mappedIndex == SwiftifyInfoPrinter::SELF_PARAM_INDEX);
9549+
printer.printLifetimeboundReturn(mappedIndex, willBeEscapable);
95059550
paramHasLifetimeInfo = true;
95069551
returnHasLifetimeInfo = true;
95079552
}
@@ -9512,7 +9557,6 @@ void ClangImporter::Implementation::swiftify(AbstractFunctionDecl *MappedDecl) {
95129557
attachMacro = true;
95139558
printer.printAvailability();
95149559
printer.printTypeMapping(typeMapping);
9515-
95169560
}
95179561

95189562
if (attachMacro) {

lib/Macros/Sources/SwiftMacros/SwiftifyImportMacro.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,14 @@ struct FunctionCallBuilder: BoundsCheckedThunkBuilder {
468468
let functionRef = DeclReferenceExprSyntax(baseName: base.name)
469469
let args: [ExprSyntax] = base.signature.parameterClause.parameters.enumerated()
470470
.map { (i: Int, param: FunctionParameterSyntax) in
471-
return pointerArgs[i] ?? ExprSyntax("\(param.name)")
471+
if let overrideArg = pointerArgs[i] {
472+
return overrideArg
473+
}
474+
if isInout(getParam(base.signature, i).type) {
475+
return ExprSyntax("&\(param.name)")
476+
} else {
477+
return ExprSyntax("\(param.name)")
478+
}
472479
}
473480
let labels: [TokenSyntax?] = base.signature.parameterClause.parameters.map { param in
474481
let firstName = param.firstName.trimmed

stdlib/public/Cxx/libstdcxx/libstdcxx.modulemap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ module std {
4242
header "ostream"
4343
header "queue"
4444
header "set"
45+
header "span"
4546
header "sstream"
4647
header "stack"
4748
header "stdexcept"
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
// REQUIRES: swift_feature_SafeInteropWrappers
2+
3+
// RUN: %empty-directory(%t)
4+
// RUN: split-file %s %t
5+
6+
// RUN: %target-swift-frontend -emit-module -plugin-path %swift-plugin-dir -o %t/Test.swiftmodule -I %t%{fs-sep}Inputs -enable-experimental-feature SafeInteropWrappers -strict-memory-safety -verify -verify-additional-file %t%{fs-sep}Inputs%{fs-sep}instance.h %t/test.swift -I %bridging-path -DVERIFY
7+
// RUN: env SWIFT_BACKTRACE="" %target-swift-frontend -emit-module -plugin-path %swift-plugin-dir -o %t/Test.swiftmodule -I %t/Inputs -enable-experimental-feature SafeInteropWrappers -strict-memory-safety -warnings-as-errors -Xcc -Werror %t/test.swift -dump-macro-expansions -I %bridging-path 2> %t/out.txt
8+
// RUN: diff --strip-trailing-cr %t/out.txt %t/out.expected
9+
10+
//--- test.swift
11+
import Instance
12+
13+
@available(macOS 13.3, iOS 16.4, watchOS 9.4, tvOS 16.4, *)
14+
func foo(_ p: inout MutableSpan<CInt>, a: A, aa: inout A, c: C/*, b: B, bb: inout B*/) {
15+
aa.basic(&p)
16+
aa.bar(&p)
17+
a.constSelf(&p)
18+
a.valSelf(&p)
19+
let _: MutableSpan<CInt> = a.lifetimeBoundSelf(3)
20+
c.refSelf(&p)
21+
//b.nonescaping(&p)
22+
//let _: MutableSpan<CInt> = bb.nonescapingLifetimebound(73)
23+
24+
#if VERIFY
25+
aa.countedSelf(&p)
26+
a.basic(&p) // expected-error{{cannot use mutating member on immutable value: 'a' is a 'let' constant}}
27+
#endif
28+
}
29+
30+
//--- Inputs/instance.h
31+
#include <ptrcheck.h>
32+
#include <lifetimebound.h>
33+
#include <swift/bridging>
34+
35+
struct A {};
36+
struct SWIFT_NONESCAPABLE B {};
37+
struct SWIFT_IMMORTAL_REFERENCE C {};
38+
39+
void basic(struct A *a, int * __counted_by(len) p __noescape, int len) __attribute__((swift_name("A.basic(self:_:_:)")));
40+
41+
void renamed(struct A *a, int * __counted_by(len) p __noescape, int len) __attribute__((swift_name("A.bar(self:_:_:)")));
42+
43+
void countedSelf(struct A * __counted_by(len)
44+
a, // expected-warning{{bounds attribute '__counted_by' ignored on parameter mapped to 'self'}}
45+
int * __counted_by(len) p __noescape, int len)
46+
__attribute__((
47+
swift_name // expected-note{{swift_name maps free function to instance method here}}
48+
("A.countedSelf(self:_:_:)")));
49+
50+
void constSelf(const struct A *a, int * __counted_by(len) p __noescape, int len) __attribute__((swift_name("A.constSelf(self:_:_:)")));
51+
52+
void valSelf(struct A a, int * __counted_by(len) p __noescape, int len) __attribute__((swift_name("A.valSelf(self:_:_:)")));
53+
54+
void refSelf(struct C *c, int * __counted_by(len) p __noescape, int len) __attribute__((swift_name("C.refSelf(self:_:_:)")));
55+
56+
int * __counted_by(len) lifetimeBoundSelf(struct A a __lifetimebound, int len) __attribute__((swift_name("A.lifetimeBoundSelf(self:_:)")));
57+
58+
//void nonescaping(const struct B *d, int * __counted_by(len) p __noescape, int len) __attribute__((swift_name("B.nonescaping(self:_:_:)")));
59+
60+
// Swift 6.2 error: a mutating method cannot have a ~Escapable 'self'
61+
// requires https://github.com/swiftlang/swift/pull/84010
62+
//int * __counted_by(len) nonescapingLifetimebound(struct B *d __lifetimebound, int len) __attribute__((swift_name("B.nonescapingLifetimebound(self:_:)")));
63+
64+
//--- Inputs/module.modulemap
65+
module Instance {
66+
header "instance.h"
67+
}
68+
69+
//--- out.expected
70+
@__swiftmacro_So1AV5basic15_SwiftifyImportfMp_.swift
71+
------------------------------
72+
/// This is an auto-generated wrapper for safer interop
73+
@_alwaysEmitIntoClient @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @_lifetime(p: copy p) @_disfavoredOverload
74+
public mutating func basic(_ p: inout MutableSpan<Int32>) {
75+
let len = Int32(exactly: p.count)!
76+
return unsafe p.withUnsafeMutableBufferPointer { _pPtr in
77+
return unsafe basic(_pPtr.baseAddress!, len)
78+
}
79+
}
80+
------------------------------
81+
@__swiftmacro_So5basic15_SwiftifyImportfMp_.swift
82+
------------------------------
83+
/// This is an auto-generated wrapper for safer interop
84+
@available(swift, obsoleted: 3, renamed: "A.basic(self:_:_:)") @_alwaysEmitIntoClient @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @_lifetime(p: copy p) @_disfavoredOverload
85+
public func basic(_ a: UnsafeMutablePointer<A>!, _ p: inout MutableSpan<Int32>) {
86+
let len = Int32(exactly: p.count)!
87+
return unsafe p.withUnsafeMutableBufferPointer { _pPtr in
88+
return unsafe basic(a, _pPtr.baseAddress!, len)
89+
}
90+
}
91+
------------------------------
92+
@__swiftmacro_So1AV3bar15_SwiftifyImportfMp_.swift
93+
------------------------------
94+
/// This is an auto-generated wrapper for safer interop
95+
@_alwaysEmitIntoClient @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @_lifetime(p: copy p) @_disfavoredOverload
96+
public mutating func bar(_ p: inout MutableSpan<Int32>) {
97+
let len = Int32(exactly: p.count)!
98+
return unsafe p.withUnsafeMutableBufferPointer { _pPtr in
99+
return unsafe bar(_pPtr.baseAddress!, len)
100+
}
101+
}
102+
------------------------------
103+
@__swiftmacro_So7renamed15_SwiftifyImportfMp_.swift
104+
------------------------------
105+
/// This is an auto-generated wrapper for safer interop
106+
@available(swift, obsoleted: 3, renamed: "A.bar(self:_:_:)") @_alwaysEmitIntoClient @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @_lifetime(p: copy p) @_disfavoredOverload
107+
public func renamed(_ a: UnsafeMutablePointer<A>!, _ p: inout MutableSpan<Int32>) {
108+
let len = Int32(exactly: p.count)!
109+
return unsafe p.withUnsafeMutableBufferPointer { _pPtr in
110+
return unsafe renamed(a, _pPtr.baseAddress!, len)
111+
}
112+
}
113+
------------------------------
114+
@__swiftmacro_So1AV9constSelf15_SwiftifyImportfMp_.swift
115+
------------------------------
116+
/// This is an auto-generated wrapper for safer interop
117+
@_alwaysEmitIntoClient @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @_lifetime(p: copy p) @_disfavoredOverload
118+
public func constSelf(_ p: inout MutableSpan<Int32>) {
119+
let len = Int32(exactly: p.count)!
120+
return unsafe p.withUnsafeMutableBufferPointer { _pPtr in
121+
return unsafe constSelf(_pPtr.baseAddress!, len)
122+
}
123+
}
124+
------------------------------
125+
@__swiftmacro_So9constSelf15_SwiftifyImportfMp_.swift
126+
------------------------------
127+
/// This is an auto-generated wrapper for safer interop
128+
@available(swift, obsoleted: 3, renamed: "A.constSelf(self:_:_:)") @_alwaysEmitIntoClient @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @_lifetime(p: copy p) @_disfavoredOverload
129+
public func constSelf(_ a: UnsafePointer<A>!, _ p: inout MutableSpan<Int32>) {
130+
let len = Int32(exactly: p.count)!
131+
return unsafe p.withUnsafeMutableBufferPointer { _pPtr in
132+
return unsafe constSelf(a, _pPtr.baseAddress!, len)
133+
}
134+
}
135+
------------------------------
136+
@__swiftmacro_So1AV7valSelf15_SwiftifyImportfMp_.swift
137+
------------------------------
138+
/// This is an auto-generated wrapper for safer interop
139+
@_alwaysEmitIntoClient @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @_lifetime(p: copy p) @_disfavoredOverload
140+
public func valSelf(_ p: inout MutableSpan<Int32>) {
141+
let len = Int32(exactly: p.count)!
142+
return unsafe p.withUnsafeMutableBufferPointer { _pPtr in
143+
return unsafe valSelf(_pPtr.baseAddress!, len)
144+
}
145+
}
146+
------------------------------
147+
@__swiftmacro_So7valSelf15_SwiftifyImportfMp_.swift
148+
------------------------------
149+
/// This is an auto-generated wrapper for safer interop
150+
@available(swift, obsoleted: 3, renamed: "A.valSelf(self:_:_:)") @_alwaysEmitIntoClient @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @_lifetime(p: copy p) @_disfavoredOverload
151+
public func valSelf(_ a: A, _ p: inout MutableSpan<Int32>) {
152+
let len = Int32(exactly: p.count)!
153+
return unsafe p.withUnsafeMutableBufferPointer { _pPtr in
154+
return unsafe valSelf(a, _pPtr.baseAddress!, len)
155+
}
156+
}
157+
------------------------------
158+
@__swiftmacro_So1AV17lifetimeBoundSelf15_SwiftifyImportfMp_.swift
159+
------------------------------
160+
/// This is an auto-generated wrapper for safer interop
161+
@_alwaysEmitIntoClient @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @_lifetime(borrow self) @_disfavoredOverload
162+
public func lifetimeBoundSelf(_ len: Int32) -> MutableSpan<Int32> {
163+
return unsafe _swiftifyOverrideLifetime(MutableSpan<Int32>(_unsafeStart: unsafe lifetimeBoundSelf(len), count: Int(len)), copying: ())
164+
}
165+
------------------------------
166+
@__swiftmacro_So17lifetimeBoundSelf15_SwiftifyImportfMp_.swift
167+
------------------------------
168+
/// This is an auto-generated wrapper for safer interop
169+
@available(swift, obsoleted: 3, renamed: "A.lifetimeBoundSelf(self:_:)") @_alwaysEmitIntoClient @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @_lifetime(borrow a) @_disfavoredOverload
170+
public func lifetimeBoundSelf(_ a: A, _ len: Int32) -> MutableSpan<Int32> {
171+
return unsafe _swiftifyOverrideLifetime(MutableSpan<Int32>(_unsafeStart: unsafe lifetimeBoundSelf(a, len), count: Int(len)), copying: ())
172+
}
173+
------------------------------
174+
@__swiftmacro_So1CV7refSelf15_SwiftifyImportfMp_.swift
175+
------------------------------
176+
/// This is an auto-generated wrapper for safer interop
177+
@_alwaysEmitIntoClient @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @_lifetime(p: copy p) @_disfavoredOverload
178+
public func refSelf(_ p: inout MutableSpan<Int32>) {
179+
let len = Int32(exactly: p.count)!
180+
return unsafe p.withUnsafeMutableBufferPointer { _pPtr in
181+
return unsafe refSelf(_pPtr.baseAddress!, len)
182+
}
183+
}
184+
------------------------------
185+
@__swiftmacro_So7refSelf15_SwiftifyImportfMp_.swift
186+
------------------------------
187+
/// This is an auto-generated wrapper for safer interop
188+
@available(swift, obsoleted: 3, renamed: "C.refSelf(self:_:_:)") @_alwaysEmitIntoClient @available(visionOS 1.0, tvOS 12.2, watchOS 5.2, iOS 12.2, macOS 10.14.4, *) @_lifetime(p: copy p) @_disfavoredOverload
189+
public func refSelf(_ c: C!, _ p: inout MutableSpan<Int32>) {
190+
let len = Int32(exactly: p.count)!
191+
return unsafe p.withUnsafeMutableBufferPointer { _pPtr in
192+
return unsafe refSelf(c, _pPtr.baseAddress!, len)
193+
}
194+
}
195+
------------------------------

test/Interop/Cxx/class/access/swiftify-private-fileid.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55

66
// REQUIRES: swift_feature_SafeInteropWrappers
77

8-
// FIXME swift-ci linux tests do not support std::span
9-
// UNSUPPORTED: OS=linux-gnu, OS=linux-android, OS=linux-androideabi
10-
118
//--- Inputs/swiftify-non-public.h
129
#pragma once
1310

test/Interop/Cxx/stdlib/std-span-interface.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
// REQUIRES: swift_feature_SafeInteropWrappers
99
// REQUIRES: swift_feature_Lifetimes
1010

11-
// FIXME swift-ci linux tests do not support std::span
12-
// UNSUPPORTED: OS=linux-gnu, OS=linux-android, OS=linux-androideabi
13-
1411
#if !BRIDGING_HEADER
1512
import StdSpan
1613
#endif

test/Interop/Cxx/stdlib/std-span-transformed-execution.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// 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)
22

3-
// FIXME swift-ci linux tests do not support std::span
4-
// UNSUPPORTED: OS=linux-gnu
5-
63
// TODO: test failed in Windows PR testing: rdar://144384453
74
// UNSUPPORTED: OS=windows-msvc
85

test/Interop/Cxx/stdlib/use-std-span-typechecker.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// RUN: %target-typecheck-verify-swift -I %S/Inputs -enable-experimental-cxx-interop -Xcc -std=c++20 2>&1
22

3-
// FIXME swift-ci linux tests do not support std::span
4-
// UNSUPPORTED: OS=linux-gnu
5-
63
import StdSpan
74

85
let arr: [Int32] = [1, 2, 3]

test/Interop/Cxx/stdlib/use-std-span.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// RUN: %target-run-simple-swift(-I %S/Inputs -Xfrontend -enable-experimental-cxx-interop -Xcc -std=c++20)
22
// 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)
33

4-
// FIXME swift-ci linux tests do not support std::span
5-
// UNSUPPORTED: OS=linux-gnu
6-
74
// TODO: test failed in Windows PR testing: rdar://144384453
85
// UNSUPPORTED: OS=windows-msvc
96

0 commit comments

Comments
 (0)