Skip to content

Commit 4ff38db

Browse files
committed
[test] Adjust for Optional relying on $NonescapableTypes now
1 parent 463f355 commit 4ff38db

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

test/Concurrency/sending_conditional_suppression.swift

+9-5
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,17 @@ public struct TestInStruct {
206206
// Make sure that we emit compiler(>= 5.3) when emitting the suppressing check
207207
// to make sure we do not fail if we fail to parse sending in the if block.
208208

209-
// CHECK: #if compiler(>=5.3) && $SendingArgsAndResults // Suppression Count: 24
209+
// CHECK: #if compiler(>=5.3) && $NonescapableTypes // Suppression Count: 24
210210
// CHECK-NEXT: @inlinable public func withCheckedContinuation<T>(isolation: isolated (any _Concurrency.Actor)? = #isolation, function: Swift.String = #function, _ body: (_Concurrency.CheckedContinuation<T, Swift.Never>) -> Swift.Void) async -> sending T {
211-
// CHECK-NEXT: fatalError()
211+
// CHECK-NEXT: fatalError()
212+
// CHECK-NEXT: }
213+
// CHECK-NEXT: #elseif compiler(>=5.3) && $SendingArgsAndResults // Suppression Count: 25
214+
// CHECK-NEXT: @inlinable public func withCheckedContinuation<T>(isolation: isolated (any _Concurrency.Actor)? = #isolation, function: Swift.String = #function, _ body: (_Concurrency.CheckedContinuation<T, Swift.Never>) -> Swift.Void) async -> sending T {
215+
// CHECK-NEXT: fatalError()
212216
// CHECK-NEXT: }
213217
// CHECK-NEXT: #else
214218
// CHECK-NEXT: @inlinable public func withCheckedContinuation<T>(isolation: isolated (any _Concurrency.Actor)? = #isolation, function: Swift.String = #function, _ body: (_Concurrency.CheckedContinuation<T, Swift.Never>) -> Swift.Void) async -> T {
215-
// CHECK-NEXT: fatalError()
219+
// CHECK-NEXT: fatalError()
216220
// CHECK-NEXT: }
217221
// CHECK-NEXT: #endif
218222
@inlinable public func withCheckedContinuation<T>(
@@ -223,14 +227,14 @@ public struct TestInStruct {
223227
fatalError()
224228
}
225229

226-
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults // Suppression Count: 25
230+
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults // Suppression Count: 26
227231
// CHECK-NEXT: public var publicGlobal: (sending test.NonSendableKlass) -> ()
228232
// CHECK-NEXT: #else
229233
// CHECK-NEXT: public var publicGlobal: (__owned test.NonSendableKlass) -> ()
230234
// CHECK-NEXT: #endif
231235
public var publicGlobal: (sending NonSendableKlass) -> () = { x in fatalError() }
232236

233-
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults // Suppression Count: 26
237+
// CHECK-LABEL: #if compiler(>=5.3) && $SendingArgsAndResults // Suppression Count: 27
234238
// CHECK-NEXT: @usableFromInline
235239
// CHECK-NEXT: internal var usableFromInlineGlobal: (sending test.NonSendableKlass) -> ()
236240
// CHECK-NEXT: #else

test/ModuleInterface/noncopyable_generics.swift

+16
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,31 @@ import NoncopyableGenerics_Misc
138138
// CHECK-MISC-NEXT: public func referToLoudProperGuarding(_ t: {{.*}}.LoudlyNC<Swift.String>)
139139
// CHECK-MISC-NEXT: public struct NoCopyPls : ~Swift.Copyable {
140140
// CHECK-MISC-NEXT: }
141+
// CHECK-MISC-NEXT: #if compiler(>=5.3) && $NonescapableTypes
142+
// CHECK-MISC-NEXT: public func substCopyable(_ t: Swift.String?)
143+
// CHECK-MISC-NEXT: #else
141144
// CHECK-MISC-NEXT: public func substCopyable(_ t: Swift.String?)
145+
// CHECK-MISC-NEXT: #endif
146+
// CHECK-MISC-NEXT: #if compiler(>=5.3) && $NonescapableTypes
147+
// CHECK-MISC-NEXT: public func substGenericCopyable<T>(_ t: T?)
148+
// CHECK-MISC-NEXT: #else
142149
// CHECK-MISC-NEXT: public func substGenericCopyable<T>(_ t: T?)
150+
// CHECK-MISC-NEXT: #endif
143151

144152
// NOTE: we really shouldn't be emitting the else branch for the two funcs
145153
// below, since the suppressed version isn't valid. We don't have a good way of
146154
// fixing that right now, either.
147155

156+
// CHECK-MISC-NEXT: #if compiler(>=5.3) && $NonescapableTypes
157+
// CHECK-MISC-NEXT: public func substNC(_ t: borrowing {{.*}}.NoCopyPls?)
158+
// CHECK-MISC-NEXT: #else
148159
// CHECK-MISC-NEXT: public func substNC(_ t: borrowing {{.*}}.NoCopyPls?)
160+
// CHECK-MISC-NEXT: #endif
161+
// CHECK-MISC-NEXT: #if compiler(>=5.3) && $NonescapableTypes
162+
// CHECK-MISC-NEXT: public func substGenericNC<T>(_ t: borrowing T?) where T : ~Copyable
163+
// CHECK-MISC-NEXT: #else
149164
// CHECK-MISC-NEXT: public func substGenericNC<T>(_ t: borrowing T?) where T : ~Copyable
165+
// CHECK-MISC-NEXT: #endif
150166

151167
// CHECK-MISC: public protocol Publik : ~Copyable {
152168
// CHECK-MISC-NEXT: }

test/stdlib/Optional.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %target-run-simple-swift(-enable-experimental-feature NonescapableTypes)
1+
// RUN: %target-run-simple-swift
22
// REQUIRES: executable_test
33
// REQUIRES: reflection
44

0 commit comments

Comments
 (0)