[ModuleInterface] Print imports (including '@_exported')

Part of preserving enough information to reconstitute a textual
interface back to a binary module.
This commit is contained in:
Jordan Rose
2018-09-06 11:43:51 -07:00
parent 737a405596
commit f6ee9f6dc9
14 changed files with 150 additions and 38 deletions

View File

@@ -0,0 +1 @@
void a(void);

View File

@@ -0,0 +1 @@
void b1(void);

View File

@@ -0,0 +1 @@
void b2(void);

View File

@@ -0,0 +1 @@
void b2(void);

View File

@@ -0,0 +1 @@
void c(void);

View File

@@ -0,0 +1 @@
void d(void);

View File

@@ -0,0 +1,8 @@
module A { header "A.h" }
module B {
explicit module B1 { header "B1.h" }
explicit module B2 { header "B2.h" }
explicit module B3 { header "B3.h" }
}
module C { header "C.h" }
module D { header "D.h" }

View File

@@ -0,0 +1,3 @@
import A
import B.B3
import D

View File

@@ -0,0 +1,19 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -o %t/empty.swiftmodule %S/../Inputs/empty.swift
// RUN: %target-swift-frontend -emit-interface-path - -emit-module -o /dev/null %s %S/Inputs/imports-other.swift -I %S/Inputs/imports-clang-modules/ -I %t -verify | %FileCheck %s
@_exported import empty
import B.B2
import func C.c // expected-warning {{scoped imports are not yet supported in textual module interfaces}}
import D
// CHECK-NOT: import
// CHECK: {{^}}import A{{$}}
// CHECK-NEXT: {{^}}import B{{$}}
// CHECK-NEXT: {{^}}import B.B2{{$}}
// CHECK-NEXT: {{^}}import B.B3{{$}}
// CHECK-NEXT: {{^}}import C/*.c*/{{$}}
// CHECK-NEXT: {{^}}import D{{$}}
// CHECK-NEXT: {{^}}@_exported import empty{{$}}
// CHECK-NOT: import