mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Use full target architectures for swiftmodule files (#21053)
Previously these used the same "major architecture" names that the `#if os(...)` query accepts, but that can be a problem when building for, say, both armv7 and armv7s, even if the content is "the same". For a transition period where external build tools are involved, the compiler will look for "arm.swiftmodule" if it fails to find "armv7.swiftmodule" or any other 32-bit ARM architecture. No other Apple platform architectures are affected, and AFAIK no one's using the architecture-based layout on Linux or any other platforms. rdar://problem/45174692
This commit is contained in:
18
test/Serialization/load-arch-fallback-framework.swift
Normal file
18
test/Serialization/load-arch-fallback-framework.swift
Normal file
@@ -0,0 +1,18 @@
|
||||
// Test the fallback for 32-bit ARM platforms.
|
||||
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: mkdir -p %t/empty.framework/Modules/empty.swiftmodule
|
||||
// RUN: %target-swift-frontend -emit-module -o %t/empty.framework/Modules/empty.swiftmodule/arm.swiftmodule %S/../Inputs/empty.swift -module-name empty
|
||||
// RUN: %target-swift-frontend -typecheck %s -F %t
|
||||
|
||||
// RUN: mv %t/empty.framework/Modules/empty.swiftmodule/arm.swiftmodule %t/empty.framework/Modules/empty.swiftmodule/%target-swiftmodule-name
|
||||
// RUN: touch %t/empty.framework/Modules/empty.swiftmodule/arm.swiftmodule
|
||||
// RUN: %target-swift-frontend -typecheck %s -F %t
|
||||
|
||||
// RUN: rm %t/empty.framework/Modules/empty.swiftmodule/%target-swiftmodule-name
|
||||
// RUN: not %target-swift-frontend -typecheck %s -F %t 2>&1 | %FileCheck %s
|
||||
|
||||
// REQUIRES: CPU=armv7 || CPU=armv7k || CPU=armv7s
|
||||
|
||||
import empty
|
||||
// CHECK: :[[@LINE-1]]:8: error: malformed module file: {{.*}}arm.swiftmodule
|
||||
Reference in New Issue
Block a user