File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed
test/Serialization/Recovery Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -747,7 +747,8 @@ void swift::serialization::diagnoseSerializedASTLoadFailure(
747
747
auto circularDependencyIter =
748
748
llvm::find_if (loadedModuleFile->getDependencies (),
749
749
[](const ModuleFile::Dependency &next) {
750
- return !next.Import .second ->hasResolvedImports ();
750
+ return next.isLoaded () &&
751
+ !next.Import .second ->hasResolvedImports ();
751
752
});
752
753
assert (circularDependencyIter !=
753
754
loadedModuleFile->getDependencies ().end () &&
Original file line number Diff line number Diff line change
1
+ //// Report dependency cycles involving missing clang modules without crashing
2
+ //// rdar://problem/57364033
3
+
4
+ // RUN: %empty-directory(%t)
5
+ // RUN: cp -r %S/Inputs/custom-modules %t/
6
+
7
+ // RUN: %target-swift-frontend -emit-module -DLIB_A %s -module-name A -emit-module-path %t/A.swiftmodule
8
+ // RUN: %target-swift-frontend -emit-module -DLIB_B %s -module-name B -emit-module-path %t/B.swiftmodule -I %t -I %t/custom-modules
9
+ // RUN: %target-swift-frontend -emit-module -DLIB_C %s -module-name C -emit-module-path %t/C.swiftmodule -I %t
10
+
11
+ //// Delete the clang module
12
+ // RUN: rm -r %t/custom-modules/
13
+
14
+ // RUN: not %target-swift-frontend -emit-module -DLIB_D %s -module-name A -emit-module-path %t/D.swiftmodule -I %t 2>&1 | %FileCheck %s
15
+
16
+ #if LIB_A
17
+
18
+ #elseif LIB_B
19
+
20
+ import IndirectImport // From custom-modules
21
+ import A
22
+
23
+ #elseif LIB_C
24
+
25
+ import B
26
+
27
+ #elseif LIB_D
28
+
29
+ import C
30
+ // CHECK: <unknown>:0: error: circular dependency between modules 'A' and 'B'
31
+
32
+ #endif
You can’t perform that action at this time.
0 commit comments