[clang] [Clang][DebugInfo] Use CGDebugInfo::createFile in CGDebugInfo::CreateCompileUnit (#83174) (PR #83175)

Adrian Prantl via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 1 10:46:12 PST 2024


================
@@ -0,0 +1,20 @@
+// RUN: mkdir -p %t/src
+// RUN: cp %s %t/src/debug-info-debug-prefix-map.c
+
+// RUN: mkdir -p %t/out
+// RUN: cd %t/out
+// RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple \
+// RUN:   -fdebug-prefix-map="%t/=./" %t/src/debug-info-debug-prefix-map.c \
+// RUN:   -emit-llvm -o - | FileCheck %s
+
+void foo(void) {}
+
+// Compile unit filename is transformed from absolute path %t/src... to
+// a relative path ./src... But it should not be relative to directory "./out".
+
+// CHECK: = distinct !DICompileUnit({{.*}}file: ![[#CUFILE:]]
+// CHECK: ![[#CUFILE]] = !DIFile(
+// CHECK-NOT:    directory: "./out"
+// CHECK-SAME:   filename: "./src{{[^"]+}}"
----------------
adrian-prantl wrote:

Can you compare this to other tests with paths in them? In my memory you need to do some fancy regex for the `/` path separator work under Windows.

https://github.com/llvm/llvm-project/pull/83175


More information about the cfe-commits mailing list