mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The previous 'openModuleFiles' interface in SerializedModuleLoaderBase still assumed that swiftmodule files and swiftdoc files would be found next to each other, but that's not true anymore with swiftinterfaces-built-to-modules. Give up on this assumption (and on the minor optimization of passing down a scratch buffer) and split out the interface into the customization point 'findModuleFilesInDirectory' and the implementation 'openModuleFiles'. The latter now takes two full paths: one for the swiftmodule, one for the swiftdoc.
26 lines
1.6 KiB
Swift
26 lines
1.6 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module -emit-parseable-module-interface-path %t/Lib.swiftinterface -emit-module-doc -parse-stdlib -o %t/Lib.swiftmodule %s
|
|
// RUN: %target-swift-ide-test -print-module -module-to-print=Lib -access-filter-public -I %t -source-filename=x > %t/from-module.txt
|
|
// RUN: %FileCheck %s < %t/from-module.txt
|
|
|
|
// RUN: rm %t/Lib.swiftmodule
|
|
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-serialized %target-swift-ide-test -print-module -module-to-print=Lib -access-filter-public -I %t -source-filename=x > %t/from-interface.txt
|
|
// RUN: diff %t/from-module.txt %t/from-interface.txt
|
|
|
|
// Try again with architecture-specific subdirectories.
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: %empty-directory(%t/Lib.swiftmodule)
|
|
// RUN: %target-swift-frontend -emit-module -emit-parseable-module-interface-path %t/Lib.swiftmodule/$(basename %target-swiftmodule-name .swiftmodule).swiftinterface -emit-module-doc -parse-stdlib -o %t/Lib.swiftmodule/%target-swiftmodule-name -module-name Lib %s
|
|
// RUN: %target-swift-ide-test -print-module -module-to-print=Lib -access-filter-public -I %t -source-filename=x > %t/from-module.txt
|
|
// RUN: %FileCheck %s < %t/from-module.txt
|
|
|
|
// RUN: rm %t/Lib.swiftmodule/%target-swiftmodule-name
|
|
// RUN: env SWIFT_FORCE_MODULE_LOADING=prefer-serialized %target-swift-ide-test -print-module -module-to-print=Lib -access-filter-public -I %t -source-filename=x > %t/from-interface.txt
|
|
// RUN: diff %t/from-module.txt %t/from-interface.txt
|
|
|
|
/// Very important documentation!
|
|
public struct SomeStructWithDocumentation {}
|
|
|
|
// CHECK: Very important documentation!
|
|
// CHECK-NEXT: struct SomeStructWithDocumentation {
|