From a0e8103ea3648240af84e6960b2c3ba0b2b12f67 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Sun, 14 Feb 2021 17:49:55 +0200 Subject: [PATCH] Test CU directory is the work_dir Make sure that we don't regress setting of the CU directory to the working directory. --- src/test/codegen/debug-compile-unit-path.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/test/codegen/debug-compile-unit-path.rs diff --git a/src/test/codegen/debug-compile-unit-path.rs b/src/test/codegen/debug-compile-unit-path.rs new file mode 100644 index 00000000000..fcb66e08576 --- /dev/null +++ b/src/test/codegen/debug-compile-unit-path.rs @@ -0,0 +1,9 @@ +// compile-flags: -g --remap-path-prefix={{cwd}}=/cwd/ --remap-path-prefix={{src-base}}=/base/ +// ignore-tidy-linelength +// +// Ensure that we remap the compile unit directory and that we set it to the compilers current +// working directory and not something else. +#![crate_type="rlib"] + +// CHECK-DAG: [[FILE:![0-9]*]] = !DIFile(filename: "/base/debug-compile-unit-path.rs{{.*}}", directory: "/cwd/") +// CHECK-DAG: {{![0-9]*}} = distinct !DICompileUnit({{.*}}file: [[FILE]]