Files
swift-mirror/test/DebugInfo/module-file-home-is-cwd.swift
Richard Howell 76dd1f9069 Set clang module directory correctly with fmodule-file-home-is-cwd
When building and importing modules built with
`-fmodule-file-home-is-cwd` we should be setting the debug info
directory to the current working directory. This matches the
behavior in clang: https://reviews.llvm.org/D134911
2023-09-29 08:32:36 -07:00

17 lines
620 B
Swift

// First populate the module cache to avoid issues with implicit modules
// and -fmodule-file-home-is-cwd.
// RUN: %target-swift-frontend -module-cache-path %t.mcp -emit-ir %s \
// RUN: -g -I %S/Inputs -o /dev/null
// RUN: %target-swift-frontend -module-cache-path %t.mcp -emit-ir %s \
// RUN: -g -I %S/Inputs -file-compilation-dir /CWD \
// RUN: -Xcc -Xclang -Xcc -fmodule-file-home-is-cwd \
// RUN: -o - | %FileCheck %s
import ClangModule.SubModule
let _ = someFunc(0)
// Ensure compilation directory is set to the debug compilation directory.
// CHECK: !DIFile(filename: "ClangModule", directory: "/CWD")