62
62
// RUN: %target-swift-frontend -cache-compile-job -module-name Test -O -cas-path %t/cas @%t/MyApp.cmd %t/test.swift \
63
63
// RUN: -emit-module -o %t/Test.swiftmodule
64
64
65
+ /// Importing binary module with bridging header built from CAS from a regluar build.
66
+ /// This should succeed even it is also importing a bridging header that shares same header dependencies (with proper header guard).
65
67
// RUN: %target-swift-frontend -typecheck -module-name User -swift-version 5 \
66
68
// RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \
67
69
// RUN: -Xcc -fmodule-map-file=%t/a.modulemap -Xcc -fmodule-map-file=%t/b.modulemap \
68
- // RUN: -I %t %t/user.swift
70
+ // RUN: -I %t %t/user.swift -import-objc-header %t/Bridging2.h
71
+
72
+ /// Importing binary module with bridging header built from CAS from a cached build. This should work without additional bridging header deps.
73
+ // RUN: %target-swift-frontend -scan-dependencies -module-name User -module-cache-path %t/clang-module-cache -O \
74
+ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import \
75
+ // RUN: %t/user.swift -o %t/deps2.json -swift-version 5 -cache-compile-job -cas-path %t/cas \
76
+ // RUN: -Xcc -fmodule-map-file=%t/a.modulemap -Xcc -fmodule-map-file=%t/b.modulemap -I %t
77
+
78
+ // RUN: %{python} %S/Inputs/GenerateExplicitModuleMap.py %t/deps2.json > %t/map2.json
79
+ // RUN: llvm-cas --cas %t/cas --make-blob --data %t/map2.json > %t/map2.casid
80
+ // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps2.json User > %t/User.cmd
81
+ // RUN: %target-swift-frontend -cache-compile-job -module-name User -O -cas-path %t/cas \
82
+ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -disable-implicit-swift-modules \
83
+ // RUN: -explicit-swift-module-map-file @%t/map2.casid @%t/User.cmd %t/user.swift \
84
+ // RUN: -emit-module -o %t/User.swiftmodule
69
85
70
86
//--- test.swift
71
- import B
72
87
public func test( ) {
73
88
b ( )
74
89
}
@@ -82,14 +97,31 @@ func user() {
82
97
test ( )
83
98
}
84
99
100
+ extension A {
101
+ public func testA( ) { }
102
+ }
103
+
104
+
85
105
//--- Bridging.h
86
106
#include " Foo.h "
107
+ #include " Foo2.h "
108
+
109
+ //--- Bridging2.h
110
+ #include " Foo.h "
111
+ #include " Foo2.h "
87
112
88
113
//--- Foo.h
89
114
#import " a.h "
90
115
116
+ //--- Foo2.h
117
+ #pragma once
118
+ int Foo = 0 ;
119
+
91
120
//--- a.h
92
121
#include " b.h "
122
+ struct A {
123
+ int a;
124
+ } ;
93
125
94
126
//--- b.h
95
127
void b( void) ;
0 commit comments