Files
swift-mirror/test/ScanDependencies/cxx-overlay-underlying-module-lookup.swift
Artem Chikin a9e0a58b46 [Dependency Scanning] Add ClangImporter's mandatory path remaps to dependency scanning query filesystem
On creation, 'ClangImporter' adds overlay modulemap files for non-modular platform libraries (e.g. glibc, libstdc++), which allows Swift code to import and use those libraries.

This change adds the same filesystem overlay to dependency scanning queries by applying them to the filesystem instantiated for each depndency scanning worker. Without these overlays EBM builds cannot discover and use non-modular system libraries on non-Darwin platforms.

Resolves rdar://151780437
2025-05-29 13:33:36 -07:00

33 lines
1.1 KiB
Swift

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -scan-dependencies -o %t/deps.json %s -cxx-interoperability-mode=default -disable-implicit-string-processing-module-import -disable-implicit-concurrency-module-import
// RUN: %validate-json %t/deps.json | %FileCheck %s
import CxxStdlib
// CHECK: "mainModuleName": "deps"
/// --------Main module
// CHECK-LABEL: "modulePath": "deps.swiftmodule",
// CHECK-NEXT: "sourceFiles": [
// CHECK-NEXT: cxx-overlay-underlying-module-lookup.swift
// CHECK-NEXT: ],
// CHECK-NEXT: "directDependencies": [
// CHECK-DAG: "clang": "CxxShim"
// CHECK-DAG: "swift": "CxxStdlib"
// CHECK-DAG: "swift": "Cxx"
// CHECK-DAG: "swift": "Swift"
// CHECK-DAG: "swift": "SwiftOnoneSupport"
// CHECK: ],
/// ----------
// CHECK-LABEL: "modulePath": "{{.*}}{{/|\\}}CxxStdlib-{{.*}}.swiftmodule"
// CHECK-NEXT: "sourceFiles": []
// CHECK-NEXT: "directDependencies": [
// CHECK-DAG: "swift": "Cxx"
// CHECK-DAG: "swift": "Swift"
// CHECK-DAG: "clang": "std"
// CHECK-DAG: "clang": "CxxStdlibShim"
// CHECK: ],