File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -233,7 +233,8 @@ SerializationOptions CompilerInvocation::computeSerializationOptions(
233
233
} else {
234
234
serializationOpts.ExtraClangOptions = getClangImporterOptions ().ExtraArgs ;
235
235
}
236
- if (LangOpts.ClangTarget ) {
236
+ if (LangOpts.ClangTarget &&
237
+ !getClangImporterOptions ().DirectClangCC1ModuleBuild ) {
237
238
serializationOpts.ExtraClangOptions .push_back (" --target=" +
238
239
LangOpts.ClangTarget ->str ());
239
240
}
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: split-file %s %t
3
+
4
+ // RUN: %target-swift-frontend -scan-dependencies -module-name Test -module-cache-path %t/clang-module-cache -O -g \
5
+ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \
6
+ // RUN: %t/main.swift -o %t/deps.json -swift-version 5 -cache-compile-job -cas-path %t/cas -Xcc -DTEST=1
7
+
8
+ // RUN: %{python} %S/Inputs/GenerateExplicitModuleMap.py %t/deps.json > %t/map.json
9
+ // RUN: llvm-cas --cas %t/cas --make-blob --data %t/map.json > %t/map.casid
10
+
11
+ // RUN: %{python} %S/Inputs/BuildCommandExtractor.py %t/deps.json Test > %t/MyApp.cmd
12
+
13
+ // RUN: echo %t/main.swift > %t/inputs.FileList
14
+ // RUN: %target-swift-frontend -emit-module -o %t/Test.swiftmodule -g -O \
15
+ // RUN: -cache-compile-job -cas-path %t/cas -swift-version 5 \
16
+ // RUN: -disable-implicit-swift-modules -swift-version 5 -enable-cross-import-overlays \
17
+ // RUN: -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import -parse-stdlib \
18
+ // RUN: -module-name Test -explicit-swift-module-map-file @%t/map.casid \
19
+ // RUN: -filelist %t/inputs.FileList @%t/MyApp.cmd
20
+
21
+ // RUN: llvm-bcanalyzer --dump %t/Test.swiftmodule | %FileCheck %s
22
+
23
+ // CHECK: <XCC abbrevid=6/> blob data = '-cc1'
24
+ // CHECK: <XCC abbrevid=6/> blob data = '-D'
25
+ // CHECK: <XCC abbrevid=6/> blob data = 'TEST=1'
26
+ // CHECK-NOT: <XCC abbrevid=6/> blob data = '--target=
27
+
28
+ //--- main.swift
29
+ public func test( ) { }
You can’t perform that action at this time.
0 commit comments