Files
swift-mirror/test/Serialization/can-import-invalid-arch.swift
Artem Chikin c73869e479 Do not fail the build on only finding incompatible-architecture modules on 'canImport'
This change refactors the module loaders to explicitly take a parameter indicating whether or not the loader is handling a 'canImport' query, in order to avoid emitting an error when finding a dependency Swift binary module with only imcompatible architecture variants present.

Resolves rdar://161175498
2025-09-23 15:26:02 -07:00

14 lines
569 B
Swift

// RUN: %empty-directory(%t)
// RUN: mkdir %t/Foo.swiftmodule
// RUN: touch %t/Foo.swiftmodule/i387.swiftmodule
// RUN: touch %t/Foo.swiftmodule/ppc65.swiftmodule
// RUN: touch %t/Foo.swiftmodule/i387.swiftdoc
// RUN: touch %t/Foo.swiftmodule/ppc65.swiftdoc
// RUN: %target-swift-frontend %s -typecheck -I %t 2>&1 | %FileCheck %s -DTARGET_ARCHITECTURE=%module-target-triple
// CHECK: {{.*}} warning: could not find module 'Foo' for target '[[TARGET_ARCHITECTURE]]'; found: {{ppc65, i387|i387, ppc65}}, at: {{.*}}Foo.swiftmodule
#if canImport(Foo)
import Foo
#endif