mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Textual module interfaces don't actually depend on SILGen, so we shouldn't need to run SILGen (or serialize an entire binary module) if we're just trying to emit a textual interface. On the other hand, if we /are/ going to run SILGen and then SIL diagnostics, we shouldn't delay those diagnostics by spending time emitting a textual interface, or for that matter a TBD file. Using this, update all the ModuleInterface tests that use `-emit-module -o /dev/null` to use `-typecheck` instead, except for those using `-merge-modules`.
23 lines
698 B
Swift
23 lines
698 B
Swift
// RUN: %target-swift-frontend -typecheck -emit-interface-path - %s -I %S/Inputs/imports-submodule-order/ | %FileCheck %s
|
|
// RUN: %target-swift-frontend -typecheck -emit-interface-path - %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
|