mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[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:
1
test/ModuleInterface/Inputs/imports-clang-modules/A.h
Normal file
1
test/ModuleInterface/Inputs/imports-clang-modules/A.h
Normal file
@@ -0,0 +1 @@
|
||||
void a(void);
|
||||
1
test/ModuleInterface/Inputs/imports-clang-modules/B1.h
Normal file
1
test/ModuleInterface/Inputs/imports-clang-modules/B1.h
Normal file
@@ -0,0 +1 @@
|
||||
void b1(void);
|
||||
1
test/ModuleInterface/Inputs/imports-clang-modules/B2.h
Normal file
1
test/ModuleInterface/Inputs/imports-clang-modules/B2.h
Normal file
@@ -0,0 +1 @@
|
||||
void b2(void);
|
||||
1
test/ModuleInterface/Inputs/imports-clang-modules/B3.h
Normal file
1
test/ModuleInterface/Inputs/imports-clang-modules/B3.h
Normal file
@@ -0,0 +1 @@
|
||||
void b2(void);
|
||||
1
test/ModuleInterface/Inputs/imports-clang-modules/C.h
Normal file
1
test/ModuleInterface/Inputs/imports-clang-modules/C.h
Normal file
@@ -0,0 +1 @@
|
||||
void c(void);
|
||||
1
test/ModuleInterface/Inputs/imports-clang-modules/D.h
Normal file
1
test/ModuleInterface/Inputs/imports-clang-modules/D.h
Normal file
@@ -0,0 +1 @@
|
||||
void d(void);
|
||||
@@ -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" }
|
||||
3
test/ModuleInterface/Inputs/imports-other.swift
Normal file
3
test/ModuleInterface/Inputs/imports-other.swift
Normal file
@@ -0,0 +1,3 @@
|
||||
import A
|
||||
import B.B3
|
||||
import D
|
||||
19
test/ModuleInterface/imports.swift
Normal file
19
test/ModuleInterface/imports.swift
Normal 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
|
||||
Reference in New Issue
Block a user