mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
By populating the memory cache before loading the module, we can avoid a cycle where a module is imported that is an overlay, which then triggers ClangImporter, which then (redundantly) triggers the import of the overlay module, which would reimport the module again, since it's import is still underway and it hasn't been entered into the cache yet. rdar://118846313
17 lines
930 B
Swift
17 lines
930 B
Swift
// REQUIRES: executable_test
|
|
// REQUIRES: objc_interop
|
|
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: %target-build-swift -emit-module %S/Inputs/overlay.swift -module-name ClangModuleWithOverlay -I %S/Inputs -emit-module-path %t/ClangModuleWithOverlay.swiftmodule
|
|
// RUN: %target-build-swift -c %S/Inputs/overlay.swift -module-name ClangModuleWithOverlay -I %S/Inputs -o %t/ClangModuleWithOverlay.o -parse-as-library
|
|
// RUN: %target-build-swift -emit-executable %s %t/ClangModuleWithOverlay.o -I %t -g -o %t/ASTSectionOverlay -module-name ASTSectionOverlay -emit-module -Xlinker -add_ast_path -Xlinker %t/ClangModuleWithOverlay.swiftmodule
|
|
|
|
// RUN: %lldb-moduleimport-test -verbose %t/ASTSectionOverlay | %FileCheck %s
|
|
// CHECK: Loading ClangModuleWithOverlay
|
|
// CHECK-NOT: Loading (overlay) ClangModuleWithOverlay
|
|
// CHECK-NOT: Loading{{.*}}ClangModuleWithOverlay
|
|
|
|
import ClangModuleWithOverlay
|
|
let c = ClangType(i: 0)
|
|
fromSwiftOverlay()
|