-
Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathgen_public_module_name.swift
44 lines (34 loc) · 1.44 KB
/
gen_public_module_name.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// RUN: %empty-directory(%t)
// RUN: split-file %s %t
// RUN: %target-swift-frontend %t/common.swift \
// RUN: -module-name Common \
// RUN: -emit-module-path %t/Common.swiftmodule \
// RUN: -emit-module-interface-path %t/Common.swiftinterface \
// RUN: -enable-library-evolution -swift-version 6
// RUN: %target-swift-frontend %t/modimpl.swift -I %t \
// RUN: -module-name BestModImpl \
// RUN: -emit-module-path %t/BestModImpl.swiftmodule \
// RUN: -emit-module-interface-path %t/BestModImpl.swiftinterface \
// RUN: -enable-library-evolution -swift-version 6 \
// RUN: -public-module-name BestMod
// RUN: %target-swift-frontend %t/mod.swift -I %t \
// RUN: -module-name BestMod \
// RUN: -emit-module-path %t/BestMod.swiftmodule \
// RUN: -emit-module-interface-path %t/BestMod.swiftinterface \
// RUN: -enable-library-evolution -swift-version 6
// RUN: %sourcekitd-test -req=interface-gen -module BestMod -- -swift-version 6 -I %t -target %target-triple &> %t/BestMod.generatedinterface
// RUN: %FileCheck -input-file=%t/BestMod.generatedinterface %s
//--- common.swift
public struct CommonType {}
//--- modimpl.swift
import struct Common.CommonType
public func fromModImpl() {}
//--- mod.swift
@_exported import BestModImpl
import struct Common.CommonType
public func fromMod() {}
// CHECK-NOT: import BestModImpl
// CHECK: import struct Common.CommonType
// CHECK-NOT: import
// CHECK: func fromMod()
// CHECK: func fromModImpl()