File tree 2 files changed +13
-1
lines changed
test/SymbolGraph/ClangImporter
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -963,6 +963,14 @@ void ModuleDecl::getDisplayDecls(SmallVectorImpl<Decl*> &Results) const {
963
963
#ifndef NDEBUG
964
964
llvm::DenseSet<Decl *> visited;
965
965
for (auto *D : Results) {
966
+ // decls synthesized from implicit clang decls may appear multiple times;
967
+ // e.g. if multiple modules with underlying clang modules are re-exported.
968
+ // including duplicates of these is harmless, so skip them when counting
969
+ // this assertion
970
+ if (const auto *CD = D->getClangDecl ()) {
971
+ if (CD->isImplicit ()) continue ;
972
+ }
973
+
966
974
auto inserted = visited.insert (D).second ;
967
975
assert (inserted && " there should be no duplicate decls" );
968
976
}
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t)
2
- // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/Submodules -emit-module-path %t/Submodules.swiftmodule -enable-objc-interop -module-name Submodules %s -emit-symbol-graph -emit-symbol-graph-dir %t
2
+ // RUN: cp -r %S/Inputs/EmitWhileBuilding/EmitWhileBuilding.framework %t
3
+ // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-objc-interop -emit-module-path %t/EmitWhileBuilding.framework/Modules/EmitWhileBuilding.swiftmodule/%target-swiftmodule-name -import-underlying-module -F %t -module-name EmitWhileBuilding -disable-objc-attr-requires-foundation-module %S/EmitWhileBuilding.swift
4
+ // RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -I %S/Inputs/Submodules -emit-module-path %t/Submodules.swiftmodule -enable-objc-interop -module-name Submodules -F %t %s -emit-symbol-graph -emit-symbol-graph-dir %t
3
5
4
6
// REQUIRES: objc_interop
5
7
8
10
@_exported import Mixed
9
11
@_exported import Mixed. Submodule
10
12
13
+ @_exported import EmitWhileBuilding
14
+
11
15
public func someFunc( ) { }
You can’t perform that action at this time.
0 commit comments