Skip to content

Commit 67caf65

Browse files
committed
---
yaml --- r: 570807 b: refs/heads/main c: 2b5fc3a h: refs/heads/main i: 570805: 0ce0da7 570803: 56d38e4 570799: dc57b44
1 parent c60c07f commit 67caf65

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2015,4 +2015,4 @@ refs/tags/swift-5.3-DEVELOPMENT-SNAPSHOT-2020-09-06-a: 539017b61d4fd33e72f269983
20152015
refs/tags/swift-5.3-DEVELOPMENT-SNAPSHOT-2020-09-07-a: 30277ea9d7139d33bf3a0b476c9f05f7140a17f0
20162016
refs/tags/swift-5.3-DEVELOPMENT-SNAPSHOT-2020-09-09-a: e1eb555e1b2365ec8b0252d9d7edec351f40f9ca
20172017
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2020-09-11-a: 48ed530cc4805b5f29fc519ec25ed290e058e674
2018-
refs/heads/main: 480e8933d7fbe6ce55ab605d2835ea1541852824
2018+
refs/heads/main: 2b5fc3a8d7714b636f6958068dcc58d8de49c512

trunk/test/SPI/client_reuse_spi.swift

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/// A module should be able to leak SPI types from an import through SPI decls
2+
3+
// RUN: %empty-directory(%t)
4+
// RUN: %target-swift-frontend -emit-module -DLIB_A %s -module-name A -emit-module-path %t/A.swiftmodule
5+
// RUN: %target-swift-frontend -emit-module -DLIB_B %s -module-name B -emit-module-path %t/B.swiftmodule -I %t
6+
// RUN: %target-swift-frontend -typecheck -verify -verify-ignore-unknown -DLIB_C %s -I %t
7+
8+
#if LIB_A
9+
10+
@_spi(A) public struct SecretStruct {
11+
@_spi(A) public func bar() {}
12+
}
13+
14+
#elseif LIB_B
15+
16+
@_spi(A) import A
17+
18+
@_spi(B) public func foo() -> SecretStruct { fatalError() }
19+
20+
#elseif LIB_C
21+
22+
@_spi(B) import B
23+
24+
var a = foo() // OK
25+
a.bar() // expected-error{{'bar' is inaccessible due to '@_spi' protection level}}
26+
27+
var b = SecretStruct() // expected-error{{use of unresolved identifier}}
28+
29+
#endif

0 commit comments

Comments
 (0)