Files
swift-mirror/test/ScanDependencies/incompatible-arch.swift
Artem Chikin d699e2fc49 [Dependency Scanning] Warn, instead of fail, when a Swift dependency query only finds modules built for incompatible target
We have adopters who are relying on directly importing the underlying Clang module in the presence of incompatible Swift modules.

Resolves rdar://162549210
2025-10-15 16:58:50 -07:00

14 lines
811 B
Swift

// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/module-cache)
// RUN: %empty-directory(%t/inputs/Foo.swiftmodule)
// RUN: touch %t/inputs/Foo.swiftmodule/i387.swiftmodule
// RUN: touch %t/inputs/Foo.swiftmodule/ppc65.swiftmodule
// RUN: %target-swift-frontend -scan-dependencies -module-cache-path %t/module-cache %s -o %t/deps.json -I %t/inputs -diagnostic-style llvm -scanner-module-validation 2>&1 | %FileCheck %s
// CHECK-DAG: warning: module file '{{.*}}Foo.swiftmodule{{/|\\}}ppc65.swiftmodule' is incompatible with this Swift compiler: built for incompatible target
// CHECK-DAG: warning: module file '{{.*}}Foo.swiftmodule{{/|\\}}i387.swiftmodule' is incompatible with this Swift compiler: built for incompatible target
// CHECK: error: unable to resolve module dependency: 'Foo'
import Foo