mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This PR adds a new flag -file-compilation-dir, which does the same thing as -ffile-compilation-dir in Clang. swiftc -g -ffile-compilation-dir=. path/to/foo.swift gives us identical debug info paths regardless of what location we compiled the file from. It's useful to debug correctly using object files built on different machines in different locations. There's also a long-existed TODO comment. Resolves SR-5694
21 lines
946 B
Swift
21 lines
946 B
Swift
// REQUIRES: OS=windows-msvc
|
|
// RUN: %target-swiftc_driver -g \
|
|
// RUN: -c -file-compilation-dir Z:\path\to \
|
|
// RUN: %s -o - -emit-ir | %FileCheck --check-prefix=CHECK-ABS %s
|
|
// RUN: %empty-directory(%t)
|
|
// RUN: mkdir -p %t
|
|
// RUN: cd %t
|
|
// RUN: xcopy %s .
|
|
// RUN: %target-swiftc_driver -g \
|
|
// RUN: -c -file-compilation-dir Z:\path\to \
|
|
// RUN: file_compilation_dir_windows.swift -o - -emit-ir | %FileCheck --check-prefix=CHECK-REL %s
|
|
// RUN: %target-swiftc_driver -g \
|
|
// RUN: -c -file-compilation-dir . \
|
|
// RUN: file_compilation_dir_windows.swift -o - -emit-ir | %FileCheck --check-prefix=CHECK-REL-CWD %s
|
|
|
|
func foo() {}
|
|
|
|
// CHECK-ABS: !DIFile(filename: "{{[a-zA-Z]:\\\\.*\\\\}}file_compilation_dir_windows.swift", directory: "Z:\\path\\to")
|
|
// CHECK-REL: !DIFile(filename: "file_compilation_dir_windows.swift", directory: "Z:\\path\\to")
|
|
// CHECK-REL-CWD: !DIFile(filename: "file_compilation_dir_windows.swift", directory: ".")
|