4
4
// RUN: cp -r %S/Inputs/lib-templates/* %t/
5
5
// RUN: split-file --leading-lines %s %t
6
6
7
+ //--- SomeUnrelatedModule.swift
8
+ // RUN: %target-swift-emit-module-interface(%t/lib/swift/SomeUnrelatedModule.swiftinterface) %t/SomeUnrelatedModule.swift -module-name SomeUnrelatedModule
9
+
7
10
//--- BothPublic.swift
8
- // RUN: %target-swift-emit-module-interface(%t.swiftinterface) %t/BothPublic.swift -enable-cross-import-overlays -I %t/lib/swift -module-name ClientLibrary
11
+ // RUN: %target-swift-emit-module-interface(%t.swiftinterface) %t/BothPublic.swift -enable-cross-import-overlays -I %t/lib/swift -module-name ClientLibrary -verify
9
12
10
13
public import DeclaringLibrary
11
14
public import BystandingLibrary
15
+ public import SomeUnrelatedModule // expected-warning {{public import of 'SomeUnrelatedModule' was not used in public declarations or inlinable code}}
12
16
13
17
public func fn( _: OverlayLibraryTy ) { }
14
18
@@ -28,7 +32,7 @@ public func fn(_: OverlayLibraryTy) {}
28
32
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %t/FirstHidden.swift -enable-cross-import-overlays -I %t/lib/swift -module-name ClientLibrary -verify
29
33
30
34
internal import DeclaringLibrary
31
- public import BystandingLibrary // expected-warning {{public import of 'BystandingLibrary' was not used in public declarations or inlinable code}}
35
+ public import BystandingLibrary
32
36
33
37
public func fn( _: OverlayLibraryTy ) { }
34
38
// expected-error @-1 {{function cannot be declared public because its parameter uses an internal type}}
@@ -38,7 +42,7 @@ public func fn(_: OverlayLibraryTy) {}
38
42
//--- SecondHidden.swift
39
43
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %t/SecondHidden.swift -enable-cross-import-overlays -I %t/lib/swift -module-name ClientLibrary -verify
40
44
41
- public import DeclaringLibrary // expected-warning {{public import of 'DeclaringLibrary' was not used in public declarations or inlinable code}}
45
+ public import DeclaringLibrary
42
46
internal import BystandingLibrary
43
47
44
48
public func fn( _: OverlayLibraryTy ) { }
@@ -66,3 +70,11 @@ private import BystandingLibrary
66
70
internal func fn( _: OverlayLibraryTy ) { }
67
71
// expected-error @-1 {{function cannot be declared internal because its parameter uses a private type}}
68
72
// expected-note @-2 {{struct 'OverlayLibraryTy' is imported by this file as 'private' from '_OverlayLibrary'}}
73
+
74
+
75
+ //--- UnusedOverlay.swift
76
+ // RUN: %target-swift-emit-module-interface(%t.swiftinterface) %t/UnusedOverlay.swift -enable-cross-import-overlays -I %t/lib/swift -module-name ClientLibrary -verify
77
+
78
+ public import DeclaringLibrary // expected-warning {{public import of 'DeclaringLibrary' was not used in public declarations or inlinable code}}
79
+ public import BystandingLibrary // expected-warning {{public import of 'BystandingLibrary' was not used in public declarations or inlinable code}}
80
+ public import SomeUnrelatedModule // expected-warning {{public import of 'SomeUnrelatedModule' was not used in public declarations or inlinable code}}
0 commit comments