6
6
// RUN: %empty-directory(%t)
7
7
// RUN: %{python} %utils/split_file.py -o %t %s
8
8
9
+ /// 1. AppleLogging
9
10
/// Create AppleLogging.swiftmodule by aliasing XLogging via -module-alias XLogging=AppleLogging
10
11
// RUN: %target-swift-frontend -module-name AppleLogging -module-alias XLogging=AppleLogging %t/FileLogging.swift -emit-module -emit-module-path %t/AppleLogging.swiftmodule
11
12
17
18
// RUN: llvm-bcanalyzer --dump %t/AppleLogging.swiftmodule | %FileCheck %s -check-prefix=BCANALYZER-FOUND
18
19
// BCANALYZER-FOUND: MODULE_NAME{{.*}}AppleLogging
19
20
20
- // RUN: not llvm-bcanalyzer --dump %t/AppleLogging.swiftmodule | %FileCheck %s -check-prefix=BCANALYZER-NOT-FOUND
21
- // BCANALYZER-NOT-FOUND: MODULE_NAME{{.*}}XLogging
21
+ // RUN: llvm-bcanalyzer --dump %t/AppleLogging.swiftmodule | not grep XLogging
22
22
23
- /// Create module Lib that imports XLogging with -module-alias XLogging=AppleLogging
23
+ /// 2. Lib
24
+ /// Create module Lib that imports XLogging WITH -module-alias XLogging=AppleLogging
24
25
// RUN: %target-swift-frontend -module-name Lib %t/FileLib.swift -module-alias XLogging=AppleLogging -I %t -emit-module -emit-module-path %t/Lib.swiftmodule -Rmodule-loading 2> %t/result-Lib.output
25
26
26
27
/// Check Lib.swiftmodule is created
27
28
// RUN: test -f %t/Lib.swiftmodule
28
29
// RUN: test -f %t/AppleLogging.swiftmodule
29
30
// RUN: not test -f %t/XLogging.swiftmodule
30
31
31
- /// Check AppleLogging.swiftmodule is loaded
32
+ /// Check AppleLogging.swiftmodule is loaded, and XLogging.swiftmodule is not loaded
32
33
// RUN: %FileCheck %s -input-file %t/result-Lib.output -check-prefix CHECK-LOAD1
33
34
// CHECK-LOAD1: remark: loaded module at {{.*}}AppleLogging.swiftmodule
34
-
35
- /// Check XLogging.swiftmodule is not loaded
36
35
// RUN: not %FileCheck %s -input-file %t/result-Lib.output -check-prefix CHECK-NOT-LOAD1
37
36
// CHECK-NOT-LOAD1: remark: loaded module at {{.*}}XLogging.swiftmodule
38
37
39
- /// Check Lib.swiftmodule contains AppleLogging and not XLogging as an imported module
38
+ /// Check Lib.swiftmodule contains AppleLogging and NOT XLogging as an imported module
40
39
/// in the binary
41
40
// RUN: llvm-bcanalyzer --dump %t/Lib.swiftmodule | %FileCheck %s -check-prefix=BCANALYZER-IMPORT1
42
41
// BCANALYZER-IMPORT1: IMPORTED_MODULE{{.*}}AppleLogging
42
+ // RUN: llvm-bcanalyzer --dump %t/Lib.swiftmodule | not grep XLogging
43
43
44
- // RUN: llvm-bcanalyzer --dump %t/Lib.swiftmodule | %FileCheck %s -check-prefix=BCANALYZER-NOT-IMPORT1
45
- // BCANALYZER-NOT-IMPORT1: IMPORTED_MODULE{{.*}}XLogging
46
-
47
- /// Create a module Client that imports Lib, without module aliasing for XLogging
44
+ /// 3. Client
45
+ /// Create a module Client that imports Lib, WITHOUT module aliasing for XLogging
48
46
// RUN: %target-swift-frontend -module-name Client %t/FileClient.swift -I %t -emit-module -emit-module-path %t/Client.swiftmodule -Rmodule-loading 2> %t/result-Client.output
49
47
50
48
/// Check Client.swiftmodule is created and Lib.swiftmodule and AppleLogging.swiftmodule are loaded
59
57
/// Check Client.swiftmodule contains Lib as an imported module in the binary
60
58
// RUN: llvm-bcanalyzer --dump %t/Client.swiftmodule | %FileCheck %s -check-prefix=BCANALYZER-IMPORT2
61
59
// BCANALYZER-IMPORT2: IMPORTED_MODULE{{.*}}Lib
60
+ // RUN: llvm-bcanalyzer --dump %t/Client.swiftmodule | not grep XLogging
62
61
63
62
64
63
// BEGIN FileLogging.swift
@@ -77,11 +76,7 @@ public func start() {
77
76
}
78
77
79
78
// BEGIN FileClient.swift
80
- import XLogging
81
79
import Lib
82
80
public func rubLib( ) {
83
81
Lib . start ( )
84
82
}
85
- public func runLog( ) {
86
- _ = XLogging . setup ( )
87
- }
0 commit comments