1+ // RUN: %empty-directory(%t)
2+ // RUN: split-file %s %t
3+
14// Check that the diagnostics are produced regardless of what primary file we're using.
2- // RUN: %target-swift-frontend -typecheck -primary-file %s %S/Inputs/inconsistent-implementation-only/2.swift %S/Inputs/inconsistent-implementation-only/3.swift -I %S/Inputs/inconsistent-implementation-only/ -verify
3- // RUN: %target-swift-frontend -typecheck %s -primary-file %S/Inputs/inconsistent-implementation-only/2.swift %S/Inputs/inconsistent-implementation-only/3.swift -I %S/Inputs/inconsistent-implementation-only/ -verify
4- // RUN: %target-swift-frontend -typecheck %s %S/Inputs/inconsistent-implementation-only/2.swift -primary-file %S/Inputs/inconsistent-implementation-only/3.swift -I %S/Inputs/inconsistent-implementation-only/ -verify
5- // RUN: %target-swift-frontend -typecheck -primary-file %s -primary-file %S/Inputs/inconsistent-implementation-only/2.swift -primary-file %S/Inputs/inconsistent-implementation-only/3.swift -I %S/Inputs/inconsistent-implementation-only/ -verify
6- // RUN: %target-swift-frontend -typecheck %s %S/Inputs/inconsistent-implementation-only/2.swift %S/Inputs/inconsistent-implementation-only/3.swift -I %S/Inputs/inconsistent-implementation-only/ -verify
5+ // RUN: %target-swift-frontend -typecheck -primary-file %t/1.swift %t/2.swift %t/3.swift -I %S/Inputs/inconsistent-implementation-only/ -verify
6+ // RUN: %target-swift-frontend -typecheck %t/1.swift -primary-file %t/2.swift %t/3.swift -I %S/Inputs/inconsistent-implementation-only/ -verify
7+ // RUN: %target-swift-frontend -typecheck %t/1.swift %t/2.swift -primary-file %t/3.swift -I %S/Inputs/inconsistent-implementation-only/ -verify
8+ // RUN: %target-swift-frontend -typecheck -primary-file %t/1.swift -primary-file %t/2.swift -primary-file %t/3.swift -I %S/Inputs/inconsistent-implementation-only/ -verify
9+ // RUN: %target-swift-frontend -typecheck %t/1.swift %t/2.swift %t/3.swift -I %S/Inputs/inconsistent-implementation-only/ -verify
10+
11+ //--- 1.swift
712
813@_implementationOnly import NotSoSecret // expected-note {{imported as implementation-only here}}
914import NotSoSecret2 // expected-warning {{'NotSoSecret2' inconsistently imported as implementation-only}} {{1-1=@_implementationOnly }}
@@ -13,3 +18,24 @@ import NotSoSecret3 // expected-warning {{'NotSoSecret3' inconsistently imported
1318import ActuallyOkay // no-warning
1419
1520@_exported import Contradictory // expected-warning {{'Contradictory' inconsistently imported as implementation-only}} {{none}}
21+
22+ //--- 2.swift
23+
24+ import NotSoSecret // expected-warning {{'NotSoSecret' inconsistently imported as implementation-only}}
25+ @_implementationOnly import NotSoSecret2 // expected-note 2 {{imported as implementation-only here}}
26+ import NotSoSecret3 // expected-warning {{'NotSoSecret3' inconsistently imported as implementation-only}}
27+
28+ @_implementationOnly import ActuallySecret // no-warning
29+ import ActuallyOkay // no-warning
30+
31+ @_implementationOnly import Contradictory // expected-note {{imported as implementation-only here}}
32+
33+ //--- 3.swift
34+
35+ @_implementationOnly import NotSoSecret
36+ import NotSoSecret2 // expected-warning {{'NotSoSecret2' inconsistently imported as implementation-only}}
37+ @_implementationOnly import NotSoSecret3 // expected-note 2 {{imported as implementation-only here}}
38+
39+ @_implementationOnly import ActuallySecret // no-warning
40+ import ActuallyOkay // no-warning
41+
0 commit comments