|
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 |
| -/// Serialize and deserialize this module, then print. |
38 |
| -// RUN: %target-swift-frontend -emit-module %s -emit-module-path %t/Merged-partial.swiftmodule -swift-version 5 -I %t -module-name Merged -enable-library-evolution |
39 |
| -// RUN: %target-swift-frontend -merge-modules %t/Merged-partial.swiftmodule -module-name Merged -emit-module -emit-module-path %t/Merged.swiftmodule -I %t -emit-module-interface-path %t/Merged.swiftinterface -emit-private-module-interface-path %t/Merged.private.swiftinterface -enable-library-evolution -swift-version 5 -I %t |
40 |
| -// RUN: %FileCheck -check-prefix=CHECK-PUBLIC %s < %t/Merged.swiftinterface |
41 |
| -// RUN: %FileCheck -check-prefix=CHECK-PRIVATE %s < %t/Merged.private.swiftinterface |
42 |
| -// RUN: %target-swift-frontend -typecheck-module-from-interface -I %t %t/Merged.swiftinterface |
43 |
| -// RUN: %target-swift-frontend -typecheck-module-from-interface -I %t %t/Merged.private.swiftinterface -module-name Merged |
44 |
| - |
45 | 37 | /// Both the public and private textual interfaces should have
|
46 | 38 | /// SPI information with `-library-level spi`.
|
47 | 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
|
@@ -157,6 +149,34 @@ public struct PublicStruct {
|
157 | 149 | // CHECK-PUBLIC-NOT: spiWrappedDefault
|
158 | 150 | }
|
159 | 151 |
|
| 152 | +@_spi(S) public enum SPIEnum { |
| 153 | +// CHECK-PRIVATE: @_spi(S) public enum SPIEnum |
| 154 | +// CHECK-PUBLIC-NOT: SPIEnum |
| 155 | + |
| 156 | + case spiEnumCase |
| 157 | + // CHECK-PRIVATE: case spiEnumCase |
| 158 | + // CHECK-PUBLIC-NOT: spiEnumCase |
| 159 | +} |
| 160 | + |
| 161 | +public enum PublicEnum { |
| 162 | + case publicCase |
| 163 | + // CHECK-PUBLIC: case publicCase |
| 164 | + // CHECK-PRIVATE: case publicCase |
| 165 | + |
| 166 | + @_spi(S) case spiCase |
| 167 | + // CHECK-PRIVATE: @_spi(S) case spiCase |
| 168 | + // CHECK-PUBLIC-NOT: spiCase |
| 169 | + |
| 170 | + @_spi(S) case spiCaseA, spiCaseB |
| 171 | + // CHECK-PRIVATE: @_spi(S) case spiCaseA, spiCaseB |
| 172 | + // CHECK-PUBLIC-NOT: spiCaseA |
| 173 | + // CHECK-PUBLIC-NOT: spiCaseB |
| 174 | + |
| 175 | + @_spi(S) case spiCaseWithPayload(_ c: SomeClass) |
| 176 | + // CHECK-PRIVATE: @_spi(S) case spiCaseWithPayload(_: {{.*}}.SomeClass) |
| 177 | + // CHECK-PUBLIC-NOT: spiCaseWithPayload |
| 178 | +} |
| 179 | + |
160 | 180 | @_spi(LocalSPI) public protocol SPIProto3 {
|
161 | 181 | // CHECK-PRIVATE: @_spi(LocalSPI) public protocol SPIProto3
|
162 | 182 | // CHECK-PUBLIC-NOT: SPIProto3
|
|
0 commit comments