Skip to content

On Apple platforms, use swiftmodule directories for the stdlib #21797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cmake/modules/AddSwift.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ endfunction()
# Compute the library subdirectory to use for the given sdk and
# architecture, placing the result in 'result_var_name'.
function(compute_library_subdir result_var_name sdk arch)
set("${result_var_name}" "${SWIFT_SDK_${sdk}_LIB_SUBDIR}/${arch}" PARENT_SCOPE)
if(sdk IN_LIST SWIFT_APPLE_PLATFORMS)
set("${result_var_name}" "${SWIFT_SDK_${sdk}_LIB_SUBDIR}" PARENT_SCOPE)
else()
set("${result_var_name}" "${SWIFT_SDK_${sdk}_LIB_SUBDIR}/${arch}" PARENT_SCOPE)
endif()
endfunction()

function(_compute_lto_flag option out_var)
Expand Down Expand Up @@ -1156,6 +1160,8 @@ function(_add_swift_library_single target name)
# Don't set PROPERTY COMPILE_FLAGS or LINK_FLAGS directly.
set(c_compile_flags ${SWIFTLIB_SINGLE_C_COMPILE_FLAGS})
set(link_flags ${SWIFTLIB_SINGLE_LINK_FLAGS})

set(library_search_subdir "${SWIFT_SDK_${SWIFTLIB_SINGLE_SDK}_LIB_SUBDIR}")
set(library_search_directories
"${SWIFTLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}"
"${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFTLIB_SINGLE_SUBDIR}"
Expand Down Expand Up @@ -1300,6 +1306,7 @@ function(_add_swift_library_single target name)
if(target_static)
set_property(TARGET "${target_static}" APPEND_STRING PROPERTY
COMPILE_FLAGS " ${c_compile_flags}")
# FIXME: The fallback paths here are going to be dynamic libraries.
set(library_search_directories
"${SWIFTSTATICLIB_DIR}/${SWIFTLIB_SINGLE_SUBDIR}"
"${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/../lib/swift/${SWIFTLIB_SINGLE_SUBDIR}"
Expand Down
40 changes: 29 additions & 11 deletions cmake/modules/SwiftSource.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ function(handle_swift_sources
endif()

if(swift_sources)
compute_library_subdir(SWIFTSOURCES_LIBRARY_SUBDIR
"${SWIFTSOURCES_SDK}" "${SWIFTSOURCES_ARCHITECTURE}")
set(objsubdir "/${SWIFTSOURCES_LIBRARY_SUBDIR}")
set(objsubdir "/${SWIFTSOURCES_SDK}/${SWIFTSOURCES_ARCHITECTURE}")

file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}${objsubdir}")

Expand Down Expand Up @@ -255,6 +253,8 @@ function(_compile_swift_files
"-nostdimport" "-parse-stdlib" "-module-name" "Swift")
list(APPEND swift_flags "-Xfrontend" "-group-info-path"
"-Xfrontend" "${GROUP_INFO_JSON_FILE}")
else()
list(APPEND swift_flags "-module-name" "${SWIFTFILE_MODULE_NAME}")
endif()

# Force swift 5 mode for Standard Library.
Expand Down Expand Up @@ -313,19 +313,32 @@ function(_compile_swift_files
list(APPEND swift_flags "-parse-as-library")

set(module_base "${module_dir}/${SWIFTFILE_MODULE_NAME}")
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
set(specific_module_dir "${module_base}.swiftmodule")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You only use this once below, I think you could just inline it there as it is already covered by the conditional.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used to form module_base as well as being passed to the install command. I didn't want the install to have to know about the particular extension here.

set(module_base "${module_base}.swiftmodule/${SWIFTFILE_ARCHITECTURE}")
endif()
set(module_file "${module_base}.swiftmodule")
set(module_doc_file "${module_base}.swiftdoc")

# FIXME: These don't really belong inside the swiftmodule, but there's not
# an obvious alternate place to put them.
set(sib_file "${module_base}.Onone.sib")
set(sibopt_file "${module_base}.O.sib")
set(sibgen_file "${module_base}.sibgen")
set(module_doc_file "${module_base}.swiftdoc")

if(SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES)
set(interface_file "${module_base}.swiftinterface")
list(APPEND swift_flags "-emit-parseable-module-interface")
list(APPEND swift_flags
"-emit-parseable-module-interface-path" "${interface_file}")
endif()

list(APPEND command_create_dirs
COMMAND "${CMAKE_COMMAND}" -E make_directory "${module_dir}")
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
list(APPEND command_create_dirs
COMMAND "${CMAKE_COMMAND}" -E make_directory "${specific_module_dir}")
else()
list(APPEND command_create_dirs
COMMAND "${CMAKE_COMMAND}" -E make_directory "${module_dir}")
endif()

# If we have extra regexp flags, check if we match any of the regexps. If so
# add the relevant flags to our swift_flags.
Expand All @@ -349,10 +362,15 @@ function(_compile_swift_files
set(optional_arg "OPTIONAL")
endif()

swift_install_in_component("${SWIFTFILE_INSTALL_IN_COMPONENT}"
FILES ${module_outputs}
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}"
"${optional_arg}")
if(SWIFTFILE_SDK IN_LIST SWIFT_APPLE_PLATFORMS)
swift_install_in_component("${SWIFTFILE_INSTALL_IN_COMPONENT}"
DIRECTORY "${specific_module_dir}"
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}")
else()
swift_install_in_component("${SWIFTFILE_INSTALL_IN_COMPONENT}"
FILES ${module_outputs}
DESTINATION "lib${LLVM_LIBDIR_SUFFIX}/swift/${library_subdir}")
endif()

set(line_directive_tool "${SWIFT_SOURCE_DIR}/utils/line-directive")
set(swift_compiler_tool "${SWIFT_NATIVE_SWIFT_TOOLS_PATH}/swiftc")
Expand Down
3 changes: 2 additions & 1 deletion lib/Frontend/CompilerInvocation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ static void updateRuntimeLibraryPath(SearchPathOptions &SearchPathOpts,
llvm::sys::path::append(LibPath, getPlatformNameForTriple(Triple));
SearchPathOpts.RuntimeLibraryPath = LibPath.str();

llvm::sys::path::append(LibPath, swift::getMajorArchitectureName(Triple));
if (!Triple.isOSDarwin())
llvm::sys::path::append(LibPath, swift::getMajorArchitectureName(Triple));
SearchPathOpts.RuntimeLibraryImportPath = LibPath.str();
}

Expand Down
19 changes: 15 additions & 4 deletions lib/Serialization/SerializedModuleLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,21 @@ SerializedModuleLoaderBase::findModule(AccessPathElem moduleID,

// Search the runtime import path.
isFramework = false;
return !findModuleFilesInDirectory(
moduleID, Ctx.SearchPathOpts.RuntimeLibraryImportPath,
moduleFilename.str(), moduleDocFilename.str(), moduleBuffer,
moduleDocBuffer);
currPath = Ctx.SearchPathOpts.RuntimeLibraryImportPath;
if (Ctx.LangOpts.Target.isOSDarwin()) {
// Apple platforms always use architecture-specific files within a
// .swiftmodule directory for the stdlib.
llvm::sys::path::append(currPath, moduleFilename.str());
return !findModuleFilesInDirectory(moduleID, currPath,
archFileNames.first,
archFileNames.second,
moduleBuffer, moduleDocBuffer);
}
// Non-Apple platforms always use single-architecture swiftmodules.
return !findModuleFilesInDirectory(moduleID, currPath,
moduleFilename.str(),
moduleDocFilename.str(),
moduleBuffer, moduleDocBuffer);
}

static std::pair<StringRef, clang::VersionTuple>
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/Imports.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// CHECK-DAG: ![[FOOMODULE:[0-9]+]] = !DIModule({{.*}}, name: "Foo", includePath: "{{.*}}test{{.*}}DebugInfo{{.*}}"
// CHECK-DAG: !DIImportedEntity(tag: DW_TAG_imported_module, scope: ![[THISFILE:[0-9]+]], entity: ![[FOOMODULE]]
// CHECK-DAG: ![[THISFILE]] = !DIFile(filename: "{{.*}}test{{/|\\5C}}DebugInfo{{/|\\5C}}Imports.swift",
// CHECK-DAG: ![[SWIFTFILE:[0-9]+]] = !DIFile(filename: "{{.*}}Swift.swiftmodule"
// CHECK-DAG: ![[SWIFTFILE:[0-9]+]] = !DIFile(filename: "{{.*}}Swift.swiftmodule{{(/.+[.]swiftmodule)?}}"
// CHECK-DAG: ![[SWIFTMODULE:[0-9]+]] = !DIModule({{.*}}, name: "Swift"
// CHECK-DAG: !DIImportedEntity(tag: DW_TAG_imported_module, scope: ![[THISFILE]], entity: ![[SWIFTMODULE]]
// CHECK-DAG: ![[BASICMODULE:[0-9]+]] = !DIModule({{.*}}, name: "basic"
Expand Down
2 changes: 1 addition & 1 deletion test/DebugInfo/variables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ print(", \(glob_b)", terminator: "")
print(", \(glob_s)", terminator: "")
var unused: Int32 = -1

// CHECK-DAG: ![[RT:[0-9]+]] ={{.*}}"{{.*}}Swift.swiftmodule"
// CHECK-DAG: ![[RT:[0-9]+]] ={{.*}}"{{.*}}Swift.swiftmodule{{(/.+[.]swiftmodule)?}}"


// Stack variables.
Expand Down
6 changes: 3 additions & 3 deletions test/Driver/loaded_module_trace.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
// CHECK: "name":"loaded_module_trace"
// CHECK: "arch":"{{[^"]*}}"
// CHECK: "swiftmodules":[
// CHECK: "{{[^"]*(/|\\\\)}}Module2.swiftmodule"
// CHECK: "{{[^"]*(/|\\\\)}}Swift.swiftmodule"
// CHECK: "{{[^"]*(/|\\\\)}}SwiftOnoneSupport.swiftmodule"
// CHECK: "{{[^"]*\\[/\\]}}Module2.swiftmodule"
// CHECK: "{{[^"]*\\[/\\]}}Swift.swiftmodule{{(\\[/\\][^"]+[.]swiftmodule)?}}"
// CHECK: "{{[^"]*\\[/\\]}}SwiftOnoneSupport.swiftmodule{{(\\[/\\][^"]+[.]swiftmodule)?}}"
// CHECK: ]
// CHECK: }

Expand Down
4 changes: 2 additions & 2 deletions test/Driver/loaded_module_trace_env.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// CHECK: "name":"loaded_module_trace_env"
// CHECK: "arch":"{{[^"]*}}"
// CHECK: "swiftmodules":[
// CHECK: "{{[^"]*(/|\\\\)}}Swift.swiftmodule"
// CHECK: "{{[^"]*(/|\\\\)}}SwiftOnoneSupport.swiftmodule"
// CHECK: "{{[^"]*\\[/\\]}}Swift.swiftmodule{{(\\[/\\][^"]+[.]swiftmodule)?}}"
// CHECK: "{{[^"]*\\[/\\]}}SwiftOnoneSupport.swiftmodule{{(\\[/\\][^"]+[.]swiftmodule)?}}"
// CHECK: ]
// CHECK: }
12 changes: 6 additions & 6 deletions test/Driver/loaded_module_trace_foundation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
// CHECK: "name":"loaded_module_trace_foundation"
// CHECK: "arch":"{{[^"]*}}"
// CHECK: "swiftmodules":[
// CHECK: "{{[^"]*}}/ObjectiveC.swiftmodule"
// CHECK: "{{[^"]*}}/Dispatch.swiftmodule"
// CHECK: "{{[^"]*}}/Darwin.swiftmodule"
// CHECK: "{{[^"]*}}/Foundation.swiftmodule"
// CHECK: "{{[^"]*}}/Swift.swiftmodule"
// CHECK: "{{[^"]*}}/SwiftOnoneSupport.swiftmodule"
// CHECK: "{{[^"]*}}/ObjectiveC.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
// CHECK: "{{[^"]*}}/Dispatch.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
// CHECK: "{{[^"]*}}/Darwin.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
// CHECK: "{{[^"]*}}/Foundation.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
// CHECK: "{{[^"]*}}/Swift.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
// CHECK: "{{[^"]*}}/SwiftOnoneSupport.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
// CHECK: ]
// CHECK: }

Expand Down
12 changes: 6 additions & 6 deletions test/Driver/loaded_module_trace_header.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
// CHECK: "name":"loaded_module_trace_header"
// CHECK: "arch":"{{[^"]*}}"
// CHECK: "swiftmodules":[
// CHECK: "{{[^"]*}}/ObjectiveC.swiftmodule"
// CHECK: "{{[^"]*}}/Dispatch.swiftmodule"
// CHECK: "{{[^"]*}}/Darwin.swiftmodule"
// CHECK: "{{[^"]*}}/Foundation.swiftmodule"
// CHECK: "{{[^"]*}}/Swift.swiftmodule"
// CHECK: "{{[^"]*}}/SwiftOnoneSupport.swiftmodule"
// CHECK: "{{[^"]*}}/ObjectiveC.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
// CHECK: "{{[^"]*}}/Dispatch.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
// CHECK: "{{[^"]*}}/Darwin.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
// CHECK: "{{[^"]*}}/Foundation.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
// CHECK: "{{[^"]*}}/Swift.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
// CHECK: "{{[^"]*}}/SwiftOnoneSupport.swiftmodule{{(\\/[^"]+[.]swiftmodule)?}}"
// CHECK: ]
// CHECK: }
8 changes: 4 additions & 4 deletions test/Driver/loaded_module_trace_multifile.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
// CHECK: "name":"loaded_module_trace_multifile"
// CHECK: "arch":"{{[^"]*}}"
// CHECK: "swiftmodules":[
// CHECK: "{{[^"]*[/\\]}}Module2.swiftmodule"
// CHECK: "{{[^"]*[/\\]}}Module.swiftmodule"
// CHECK: "{{[^"]*[/\\]}}Swift.swiftmodule"
// CHECK: "{{[^"]*[/\\]}}SwiftOnoneSupport.swiftmodule"
// CHECK-DAG: "{{[^"]*\\[/\\]}}Module2.swiftmodule"
// CHECK-DAG: "{{[^"]*\\[/\\]}}Module.swiftmodule"
// CHECK-DAG: "{{[^"]*\\[/\\]}}Swift.swiftmodule{{(\\[/\\][^"]+[.]swiftmodule)?}}"
// CHECK-DAG: "{{[^"]*\\[/\\]}}SwiftOnoneSupport.swiftmodule{{(\\[/\\][^"]+[.]swiftmodule)?}}"
// CHECK: ]
// CHECK: }

Expand Down
4 changes: 2 additions & 2 deletions test/Frontend/dependencies.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

// CHECK-BASIC-YAML-LABEL: depends-external:
// CHECK-BASIC-YAML-NOT: empty\ file.swift
// CHECK-BASIC-YAML: "{{.*}}{{/|\\}}Swift.swiftmodule"
// CHECK-BASIC-YAML: "{{.*}}{{/|\\}}Swift.swiftmodule{{(/.+[.]swiftmodule)?}}"
// CHECK-BASIC-YAML-NOT: {{:$}}


Expand Down Expand Up @@ -80,7 +80,7 @@

// CHECK-IMPORT-YAML-LABEL: depends-external:
// CHECK-IMPORT-YAML-NOT: dependencies.swift
// CHECK-IMPORT-YAML-DAG: "{{.*}}{{/|\\}}Swift.swiftmodule"
// CHECK-IMPORT-YAML-DAG: "{{.*}}{{/|\\}}Swift.swiftmodule{{(/.+[.]swiftmodule)?}}"
// CHECK-IMPORT-YAML-DAG: "{{.*}}Inputs/dependencies/$$$$$.h"
// CHECK-IMPORT-YAML-DAG: "{{.*}}Inputs/dependencies{{/|\\\\}}UserClangModule.h"
// CHECK-IMPORT-YAML-DAG: "{{.*}}Inputs/dependencies/extra-header.h"
Expand Down
29 changes: 15 additions & 14 deletions test/Index/Store/unit-one-file-multi-file-invocation.swift
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
// RUN: rm -rf %t
// RUN: %target-build-swift -index-file -index-file-path %s %s %S/Inputs/SwiftModuleA.swift -module-name unit_one_test -o %t.output_for_index -index-store-path %t/idx
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s -check-prefix=UNIT
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -index-file -index-file-path %s %s %S/Inputs/SwiftModuleA.swift -module-name unit_one_test -o %t/00-output_for_index -index-store-path %t/idx
// RUN: c-index-test core -print-unit %t/idx | %FileCheck %s -implicit-check-not SwiftShims

// UNIT-NOT: SwiftShims
// The output is sorted by last path component, so make sure the top-level entry
// gets sorted first by prepending 0s.

// UNIT: [[SWIFT:Swift.swiftmodule-[A-Z0-9]*]]
// UNIT: DEPEND START
// UNIT: Record | system | Swift.Math.Floating | {{.*}}Swift.swiftmodule | Swift.swiftmodule_Math_Floating-{{.*}}
// UNIT: Record | system | Swift.String | {{.*}}Swift.swiftmodule | Swift.swiftmodule_String-{{.*}}
// UNIT: DEPEND END
// CHECK: 00-output_for_index
// CHECK: DEPEND START
// CHECK: Unit | system | Swift | [[MODULE:.*[/\\]Swift[.]swiftmodule([/\\].+[.]swiftmodule)?]] | [[SWIFT:.+[.]swiftmodule-[A-Z0-9]*]]
// CHECK: Record | user | {{.*}}{{/|\\}}unit-one-file-multi-file-invocation.swift |
// CHECK: DEPEND END (2)

// UNIT: unit-one-file-multi-file-invocation{{.*}}.output_for_index
// UNIT: DEPEND START
// UNIT: Unit | system | {{.*}}{{/|\\}}Swift.swiftmodule | [[SWIFT]]
// UNIT: Record | user | {{.*}}{{/|\\}}unit-one-file-multi-file-invocation.swift |
// UNIT: DEPEND END (2)
// CHECK: [[SWIFT]]
// CHECK: DEPEND START
// CHECK: Record | system | Swift.Math.Floating | [[MODULE]] | {{.+}}.swiftmodule_Math_Floating-{{.*}}
// CHECK: Record | system | Swift.String | [[MODULE]] | {{.+}}.swiftmodule_String-{{.*}}
// CHECK: DEPEND END

func test1() {
funcSwiftA()
Expand Down
22 changes: 9 additions & 13 deletions test/ParseableInterface/ModuleCache/module-cache-init.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
// RUN: test -f %t/modulecache/LeafModule-*.swiftmodule
// RUN: llvm-bcanalyzer -dump %t/modulecache/LeafModule-*.swiftmodule | %FileCheck %s -check-prefix=CHECK-LEAFMODULE
// CHECK-LEAFMODULE: {{MODULE_NAME.*blob data = 'LeafModule'}}
// CHECK-LEAFMODULE: {{FILE_DEPENDENCY.*Swift.swiftmodule'}}
// CHECK-LEAFMODULE: {{FILE_DEPENDENCY.*Swift.swiftmodule([/\\].+[.]swiftmodule)?'}}
// CHECK-LEAFMODULE: {{FILE_DEPENDENCY.*LeafModule.swiftinterface'}}
// CHECK-LEAFMODULE: FUNC_DECL
//
Expand All @@ -37,7 +37,7 @@
// RUN: test -f %t/TestModule.d
// RUN: llvm-bcanalyzer -dump %t/modulecache/OtherModule-*.swiftmodule | %FileCheck %s -check-prefix=CHECK-OTHERMODULE
// CHECK-OTHERMODULE: {{MODULE_NAME.*blob data = 'OtherModule'}}
// CHECK-OTHERMODULE: {{FILE_DEPENDENCY.*Swift.swiftmodule'}}
// CHECK-OTHERMODULE: {{FILE_DEPENDENCY.*Swift.swiftmodule([/\\].+[.]swiftmodule)?'}}
// CHECK-OTHERMODULE: {{FILE_DEPENDENCY.*LeafModule.swiftinterface'}}
// CHECK-OTHERMODULE: {{FILE_DEPENDENCY.*LeafModule-.*.swiftmodule'}}
// CHECK-OTHERMODULE: {{FILE_DEPENDENCY.*OtherModule.swiftinterface'}}
Expand All @@ -50,21 +50,17 @@
//
// So we cannot write a single set of CHECK-SAME lines here that will work
// for all targets: some will have LeafModule first, some OtherModule
// first. So instead, we write two sets of patterns, and run FileCheck
// twice. Yes this is silly.
// first. So instead we just use CHECK-DAG.
//
// RUN: %FileCheck %s -check-prefix=CHECK-DEPENDS <%t/TestModule.d
// RUN: %FileCheck %s -check-prefix=CHECK-DEPENDSAGAIN <%t/TestModule.d
//
// CHECK-DEPENDS: TestModule.swiftmodule :
// CHECK-DEPENDS-SAME: LeafModule.swiftinterface
// CHECK-DEPENDS-SAME: OtherModule.swiftinterface
// CHECK-DEPENDS-SAME: {{OtherModule-[^ ]+.swiftmodule}}
// CHECK-DEPENDS-SAME: Swift.swiftmodule
// CHECK-DEPENDS-SAME: SwiftOnoneSupport.swiftmodule
//
// CHECK-DEPENDSAGAIN: TestModule.swiftmodule :
// CHECK-DEPENDSAGAIN-SAME: {{LeafModule-[^ ]+.swiftmodule}}
// CHECK-DEPENDS-DAG: LeafModule.swiftinterface
// CHECK-DEPENDS-DAG: OtherModule.swiftinterface
// CHECK-DEPENDS-DAG: {{OtherModule-[^ ]+.swiftmodule}}
// CHECK-DEPENDS-DAG: Swift.swiftmodule
// CHECK-DEPENDS-DAG: SwiftOnoneSupport.swiftmodule
// CHECK-DEPENDS-DAG: {{LeafModule-[^ ]+.swiftmodule}}

import OtherModule

Expand Down
4 changes: 2 additions & 2 deletions test/SIL/Serialization/deserialize_appkit.sil
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Make sure that we can deserialize AppKit.
// RUN: %target-sil-opt %platform-sdk-overlay-dir/AppKit.swiftmodule > /dev/null
// RUN: llvm-bcanalyzer %platform-sdk-overlay-dir/AppKit.swiftmodule | %FileCheck %s
// RUN: %target-sil-opt %platform-sdk-overlay-dir/AppKit.swiftmodule/%target-swiftmodule-name -module-name AppKit > /dev/null
// RUN: llvm-bcanalyzer %platform-sdk-overlay-dir/AppKit.swiftmodule/%target-swiftmodule-name | %FileCheck %s

// REQUIRES: objc_interop
// REQUIRES: OS=macosx
Expand Down
4 changes: 2 additions & 2 deletions test/SIL/Serialization/deserialize_coregraphics.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Make sure that we can deserialize CoreGraphics.
// RUN: %target-sil-opt %platform-sdk-overlay-dir/CoreGraphics.swiftmodule > /dev/null
// RUN: llvm-bcanalyzer %platform-sdk-overlay-dir/CoreGraphics.swiftmodule | %FileCheck %s
// RUN: %target-sil-opt %platform-sdk-overlay-dir/CoreGraphics.swiftmodule/%target-swiftmodule-name -module-name CoreGraphics > /dev/null
// RUN: llvm-bcanalyzer %platform-sdk-overlay-dir/CoreGraphics.swiftmodule/%target-swiftmodule-name | %FileCheck %s

// REQUIRES: objc_interop

Expand Down
4 changes: 2 additions & 2 deletions test/SIL/Serialization/deserialize_darwin.sil
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Make sure that we can deserialize darwin.
// RUN: %target-sil-opt %platform-sdk-overlay-dir/Darwin.swiftmodule > /dev/null
// RUN: llvm-bcanalyzer %platform-sdk-overlay-dir/Darwin.swiftmodule | %FileCheck %s
// RUN: %target-sil-opt %platform-sdk-overlay-dir/Darwin.swiftmodule/%target-swiftmodule-name -module-name Darwin > /dev/null
// RUN: llvm-bcanalyzer %platform-sdk-overlay-dir/Darwin.swiftmodule/%target-swiftmodule-name | %FileCheck %s

// REQUIRES: objc_interop

Expand Down
4 changes: 2 additions & 2 deletions test/SIL/Serialization/deserialize_foundation.sil
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Make sure that we can deserialize foundation.
// RUN: %target-sil-opt %platform-sdk-overlay-dir/Foundation.swiftmodule > /dev/null
// RUN: llvm-bcanalyzer %platform-sdk-overlay-dir/Foundation.swiftmodule | %FileCheck %s
// RUN: %target-sil-opt %platform-sdk-overlay-dir/Foundation.swiftmodule/%target-swiftmodule-name -module-name Foundation > /dev/null
// RUN: llvm-bcanalyzer %platform-sdk-overlay-dir/Foundation.swiftmodule/%target-swiftmodule-name | %FileCheck %s

// REQUIRES: objc_interop

Expand Down
4 changes: 2 additions & 2 deletions test/SIL/Serialization/deserialize_objectivec.sil
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Make sure that we can deserialize Objective-C.
// RUN: %target-sil-opt %platform-sdk-overlay-dir/ObjectiveC.swiftmodule > /dev/null
// RUN: llvm-bcanalyzer %platform-sdk-overlay-dir/ObjectiveC.swiftmodule | %FileCheck %s
// RUN: %target-sil-opt %platform-sdk-overlay-dir/ObjectiveC.swiftmodule/%target-swiftmodule-name -module-name ObjectiveC > /dev/null
// RUN: llvm-bcanalyzer %platform-sdk-overlay-dir/ObjectiveC.swiftmodule/%target-swiftmodule-name | %FileCheck %s

// REQUIRES: objc_interop

Expand Down
5 changes: 3 additions & 2 deletions test/SIL/Serialization/deserialize_stdlib.sil
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Make sure that we can deserialize the stdlib.
// RUN: %target-sil-opt %platform-module-dir/Swift.swiftmodule > /dev/null
// RUN: llvm-bcanalyzer %platform-module-dir/Swift.swiftmodule | %FileCheck %s
// RUN: %target-sil-opt %platform-module-dir/Swift.swiftmodule/%target-swiftmodule-name -module-name Swift > /dev/null || %target-sil-opt %platform-module-dir/Swift.swiftmodule -module-name Swift > /dev/null
// RUN: llvm-bcanalyzer %platform-module-dir/Swift.swiftmodule/%target-swiftmodule-name > %t || llvm-bcanalyzer %platform-module-dir/Swift.swiftmodule > %t
// RUN: %FileCheck %s < %t

// CHECK-NOT: Unknown
2 changes: 1 addition & 1 deletion test/SourceKit/Indexing/index_with_swift_module.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func foo(a: TwoInts) {

// CHECK: key.kind: source.lang.swift.import.module.swift
// CHECK-NEXT: key.name: "Swift"
// CHECK-NEXT: key.filepath: "{{.*[/\\]}}Swift.swiftmodule"
// CHECK-NEXT: key.filepath: "{{.*[/\\]Swift[.]swiftmodule([/\\].+[.]swiftmodule)?}}"
// CHECK-NEXT: key.hash:

// CHECK: key.kind: source.lang.swift.import.module.swift
Expand Down
Loading