mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Fixes a longstanding issue where submodules with the same name in different top-level modules weren't being sorted deterministically. This doesn't come up very much in practice, and it would have been hard to notice anything wrong, but it's good to be right.
23 lines
728 B
Swift
23 lines
728 B
Swift
// RUN: %target-swift-frontend -emit-interface-path - -emit-module -o /dev/null %s -I %S/Inputs/imports-submodule-order/ | %FileCheck %s
|
|
// RUN: %target-swift-frontend -emit-interface-path - -emit-module -o /dev/null %s -I %S/Inputs/imports-submodule-order/ -D XY | %FileCheck %s
|
|
|
|
#if XY
|
|
@_exported import X.Submodule
|
|
@_exported import Y.Submodule
|
|
|
|
#else
|
|
@_exported import Y.Submodule
|
|
@_exported import X.Submodule
|
|
|
|
#endif
|
|
|
|
// The order below is not alphabetical, just deterministic given a set of
|
|
// imports across any number of files and in any order.
|
|
|
|
// CHECK-NOT: import
|
|
// CHECK: import X.Submodule{{$}}
|
|
// CHECK-NEXT: import Y.Submodule{{$}}
|
|
// CHECK-NEXT: import X{{$}}
|
|
// CHECK-NEXT: import Y{{$}}
|
|
// CHECK-NOT: import
|