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