mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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
14 lines
569 B
Swift
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
|