Files
swift-mirror/test/Serialization/load-target-fallback.swift
Brent Royal-Gordon c1cc51d1f3 Use target triple for “universal” modules
When loading a module supporting multiple targets, the module loader now looks for a file named with a normalized version of the target triple first, and only falls back to the architecture name if the normalized triple is not found.
2019-02-27 11:43:12 -08:00

29 lines
1.4 KiB
Swift

// RUN: %empty-directory(%t)
// Tests that we prefer the normalized target triple name for a .swiftmodule,
// but fall back to the legacy architecture name if necessary.
// RUN: mkdir %t/TargetLibrary.swiftmodule
// RUN: %target-swift-frontend -emit-module -o %t/TargetLibrary.swiftmodule/%module-target-triple.swiftmodule %S/Inputs/def_func.swift -module-name TargetLibrary
// RUN: touch %t/TargetLibrary.swiftmodule/%target-cpu.swiftmodule
import TargetLibrary
// RUN: mkdir %t/ArchLibrary.swiftmodule
// RUN: %target-swift-frontend -emit-module -o %t/ArchLibrary.swiftmodule/%target-cpu.swiftmodule %S/Inputs/def_func.swift -module-name ArchLibrary
import ArchLibrary
// RUN: mkdir -p %t/TargetModule.framework/Modules/TargetModule.swiftmodule
// RUN: %target-swift-frontend -emit-module -o %t/TargetModule.framework/Modules/TargetModule.swiftmodule/%module-target-triple.swiftmodule %S/Inputs/def_func.swift -module-name TargetModule
// RUN: touch %t/TargetModule.framework/Modules/TargetModule.swiftmodule/%target-cpu.swiftmodule
import TargetModule
// RUN: mkdir -p %t/ArchModule.framework/Modules/ArchModule.swiftmodule
// RUN: %target-swift-frontend -emit-module -o %t/ArchModule.framework/Modules/ArchModule.swiftmodule/%target-cpu.swiftmodule %S/Inputs/def_func.swift -module-name ArchModule
import ArchModule
// RUN: %target-swift-frontend %s -typecheck -I %t -F %t