Files
swift-mirror/test/DebugInfo/debug_prefix_map_abs_rel_subdir.swift
Adrian Prantl bc8bb830a8 Add support for relative paths in debug prefix maps.
Users may want to use -fdebug-prefix-map to remap a directory to "./".
This wasn't supported previously and resulted in duplicate path
prefixes in the debug info.

With this patch swiftc behaves similar to clang when remapping a path
to a relative path.

rdar://83753143
2021-11-04 11:17:52 -07:00

14 lines
577 B
Swift

// RUN: %empty-directory(%t)
// RUN: mkdir -p %t/SubdirectoryWithAVeryUniqueName
// RUN: cd %t/SubdirectoryWithAVeryUniqueName
// RUN: cp %s .
// RUN: %target-swiftc_driver -g -debug-prefix-map %t=. \
// RUN: %t/SubdirectoryWithAVeryUniqueName/debug_prefix_map_abs_rel_subdir.swift \
// RUN: -emit-ir -o - | %FileCheck %s
public func f() {}
// CHECK-NOT: debug_prefix_map_abs_rel_subdir.swift
// CHECK: !DIFile(filename: "debug_prefix_map_abs_rel_subdir.swift", directory: ".{{/|\\\\}}SubdirectoryWithAVeryUniqueName")
// CHECK-NOT: debug_prefix_map_abs_rel_subdir.swift