|
29 | 29 |
|
30 | 30 | /// Test the textual interfaces generated from this test. |
31 | 31 | // RUN: %target-swift-frontend -typecheck %s -emit-module-interface-path %t/Main.swiftinterface -emit-private-module-interface-path %t/Main.private.swiftinterface -enable-library-evolution -swift-version 5 -I %t -module-name Main |
32 | | -// RUN: %FileCheck -check-prefix=CHECK-PUBLIC %s < %t/Main.swiftinterface |
33 | | -// RUN: %FileCheck -check-prefix=CHECK-PRIVATE %s < %t/Main.private.swiftinterface |
| 32 | +// RUN: cat %t/Main.swiftinterface | %FileCheck -check-prefix=CHECK-PUBLIC %s |
| 33 | +// RUN: cat %t/Main.private.swiftinterface | %FileCheck -check-prefix=CHECK-PRIVATE %s |
34 | 34 | // RUN: %target-swift-frontend -typecheck-module-from-interface -I %t %t/Main.swiftinterface |
35 | 35 | // RUN: %target-swift-frontend -typecheck-module-from-interface -I %t %t/Main.private.swiftinterface -module-name Main |
36 | 36 |
|
37 | 37 | /// Both the public and private textual interfaces should have |
38 | 38 | /// SPI information with `-library-level spi`. |
39 | 39 | // RUN: %target-swift-frontend -typecheck %s -emit-module-interface-path %t/SPIModule.swiftinterface -emit-private-module-interface-path %t/SPIModule.private.swiftinterface -enable-library-evolution -swift-version 5 -I %t -module-name SPIModule -library-level spi |
40 | | -// RUN: %FileCheck -check-prefix=CHECK-PRIVATE %s < %t/SPIModule.swiftinterface |
41 | | -// RUN: %FileCheck -check-prefix=CHECK-PRIVATE %s < %t/SPIModule.private.swiftinterface |
| 40 | +// RUN: cat %t/SPIModule.swiftinterface | %FileCheck -check-prefix=CHECK-PRIVATE %s |
| 41 | +// RUN: cat %t/SPIModule.private.swiftinterface | %FileCheck -check-prefix=CHECK-PRIVATE %s |
42 | 42 | // RUN: %target-swift-frontend -typecheck-module-from-interface -I %t %t/SPIModule.swiftinterface |
43 | 43 | // RUN: %target-swift-frontend -typecheck-module-from-interface -I %t %t/SPIModule.private.swiftinterface -module-name SPIModule |
44 | 44 |
|
@@ -238,6 +238,11 @@ extension IOIPublicStruct : LocalPublicProto {} |
238 | 238 | // CHECK-PRIVATE: @_spi(S) private var spiTypeInFrozen1 |
239 | 239 | } |
240 | 240 |
|
| 241 | +public struct OpType {} |
| 242 | +@_spi(S) public func +(_ s1: OpType, _ s2: OpType) -> OpType { s1 } |
| 243 | +// CHECK-PRIVATE: @_spi(S) public func + (s1: {{.*}}.OpType, s2: {{.*}}.OpType) -> {{.*}}.OpType |
| 244 | +// CHECK-PUBLIC-NOT: func + |
| 245 | + |
241 | 246 | // The dummy conformance should be only in the private swiftinterface for |
242 | 247 | // SPI extensions. |
243 | 248 | @_spi(LocalSPI) |
|
0 commit comments