|
1 | 1 | // RUN: %empty-directory(%t) |
2 | 2 | // RUN: %target-swift-frontend %s -typecheck -enable-library-evolution -parse-as-library -emit-module-interface-path - -module-name MyFile -swift-version 6 | %FileCheck %s |
3 | | -// RUN: %target-swift-frontend %s -typecheck -enable-library-evolution -parse-as-library -emit-module-interface-path - -module-name MyFile -swift-version 6 -module-interface-preserve-types-as-written | %FileCheck %S/Inputs/sending_interfacefile_printing_repr_filecheck |
| 3 | +// RUN: %target-swift-frontend %s -typecheck -enable-library-evolution -parse-as-library -emit-module-interface-path - -module-name MyFile -swift-version 6 -module-interface-preserve-types-as-written | %FileCheck -check-prefix=CHECK-REPR %s |
4 | 4 |
|
5 | 5 | // The force printing type reprs option is only available in asserts builds. |
6 | 6 | // REQUIRES: asserts |
|
11 | 11 |
|
12 | 12 | public class NonSendableKlass {} |
13 | 13 |
|
14 | | -// The two possible outputs are MyFile.NonSendableKlass and NonSendableKlass. |
15 | | -// |
16 | | -// So we just check for an optional M |
17 | 14 | // CHECK: #if compiler(>=5.3) && $SendingArgsAndResults |
18 | 15 | // CHECK-NEXT: public func test() -> sending MyFile.NonSendableKlass |
19 | 16 | // CHECK-NEXT: #else |
20 | 17 | // CHECK-NEXT: public func test() -> MyFile.NonSendableKlass |
21 | 18 | // CHECK-NEXT: #endif |
| 19 | + |
| 20 | +// CHECK-REPR: #if compiler(>=5.3) && $SendingArgsAndResults |
| 21 | +// CHECK-REPR-NEXT: public func test() -> sending NonSendableKlass |
| 22 | +// CHECK-REPR-NEXT: #else |
| 23 | +// CHECK-REPR-NEXT: public func test() -> NonSendableKlass |
| 24 | +// CHECK-REPR-NEXT: #endif |
22 | 25 | public func test() -> sending NonSendableKlass { NonSendableKlass() } |
23 | 26 |
|
24 | 27 | // CHECK: #if compiler(>=5.3) && $SendingArgsAndResults |
25 | 28 | // CHECK-NEXT: public func test2(_ x: sending MyFile.NonSendableKlass) |
26 | 29 | // CHECK-NEXT: #else |
27 | 30 | // CHECK-NEXT: public func test2(_ x: __owned MyFile.NonSendableKlass) |
28 | 31 | // CHECK-NEXT: #endif |
| 32 | + |
| 33 | +// CHECK-REPR: #if compiler(>=5.3) && $SendingArgsAndResults |
| 34 | +// CHECK-REPR-NEXT: public func test2(_ x: sending NonSendableKlass) |
| 35 | +// CHECK-REPR-NEXT: #else |
| 36 | +// CHECK-REPR-NEXT: public func test2(_ x: __owned NonSendableKlass) |
| 37 | +// CHECK-REPR-NEXT: #endif |
29 | 38 | public func test2(_ x: sending NonSendableKlass) {} |
30 | 39 |
|
31 | 40 | // CHECK: #if compiler(>=5.3) && $SendingArgsAndResults |
32 | 41 | // CHECK-NEXT: @_Concurrency.MainActor public var closure: () -> sending MyFile.NonSendableKlass |
33 | 42 | // CHECK-NEXT: #else |
34 | 43 | // CHECK-NEXT: @_Concurrency.MainActor public var closure: () -> MyFile.NonSendableKlass |
35 | 44 | // CHECK-NEXT: #endif |
| 45 | + |
| 46 | +// CHECK-REPR: #if compiler(>=5.3) && $SendingArgsAndResults |
| 47 | +// CHECK-REPR-NEXT: @_Concurrency.MainActor public var closure: () -> sending NonSendableKlass |
| 48 | +// CHECK-REPR-NEXT: #else |
| 49 | +// CHECK-REPR-NEXT: @_Concurrency.MainActor public var closure: () -> NonSendableKlass |
| 50 | +// CHECK-REPR-NEXT: #endif |
36 | 51 | @MainActor public var closure: () -> sending NonSendableKlass = { NonSendableKlass() } |
0 commit comments