|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: %target-build-swift %s -module-name SkipsSPI -emit-module -emit-module-path %t/ |
| 3 | +// RUN: %target-swift-symbolgraph-extract -module-name SkipsSPI -I %t -pretty-print -output-dir %t |
| 4 | +// RUN: %FileCheck %s --input-file %t/SkipsSPI.symbols.json |
| 5 | + |
| 6 | +// CHECK-NOT: ShouldntAppear |
| 7 | + |
| 8 | +@_spi(OtherModule) |
| 9 | +public struct StructShouldntAppear { |
| 10 | + // This shouldn't appear because the owner is @_spi(OtherModule). |
| 11 | + public func functionShouldntAppear() {} |
| 12 | + |
| 13 | + // Although not @_spi(OtherModule), is in @_spi(OtherModule) struct, so shouldn't appear. |
| 14 | + public struct InnerStructShouldntAppear {} |
| 15 | +} |
| 16 | + |
| 17 | +@_spi(OtherModule) |
| 18 | +public func functionShouldntAppear() {} |
| 19 | + |
| 20 | +@_spi(OtherModule) |
| 21 | +public protocol ProtocolShouldntAppear {} |
| 22 | + |
| 23 | +@_spi(OtherModule) |
| 24 | +public enum EnumShouldntAppear {} |
| 25 | + |
| 26 | +@_spi(OtherModule) |
| 27 | +public class ClassShouldntAppear {} |
| 28 | + |
| 29 | +// This struct should appear |
| 30 | +public struct StructShouldAppear { |
| 31 | + |
| 32 | + // This shouldn't appear beacause it is @_spi(OtherModule), despite `StructShouldAppear`. |
| 33 | + @_spi(OtherModule) |
| 34 | + public func functionShouldntAppear() {} |
| 35 | + |
| 36 | + // This shouldn't appear beacause it is @_spi(OtherModule), despite `StructShouldAppear`. |
| 37 | + @_spi(OtherModule) |
| 38 | + public struct InnerStructShouldntAppear {} |
| 39 | +} |
| 40 | + |
| 41 | +extension StructShouldAppear { |
| 42 | + // This shouldn't appear because it is @_spi(OtherModule), despite `StructShouldAppear`. |
| 43 | + @_spi(OtherModule) |
| 44 | + public func extendedFunctionShouldntAppear() {} |
| 45 | +} |
| 46 | + |
| 47 | +extension StructShouldAppear.InnerStructShouldntAppear { |
| 48 | + |
| 49 | + // This should not appear because `StructShouldAppear.InnerStructShouldntAppear` |
| 50 | + // is @_spi(OtherModule). |
| 51 | + public func extendedFunctionShouldntAppear() {} |
| 52 | +} |
| 53 | + |
| 54 | +extension StructShouldntAppear.InnerStructShouldntAppear { |
| 55 | + // This should not appear because `StructShouldntAppear.InnerStructShouldntAppear` |
| 56 | + // is @_spi(OtherModule). |
| 57 | + @_spi(OtherModule) |
| 58 | + public func extendedFunctionShouldntAppear() {} |
| 59 | +} |
0 commit comments