summaryrefslogtreecommitdiffstats
path: root/clang/test/CoverageMapping/debug-dir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CoverageMapping/debug-dir.cpp')
-rw-r--r--clang/test/CoverageMapping/debug-dir.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/CoverageMapping/debug-dir.cpp b/clang/test/CoverageMapping/debug-dir.cpp
new file mode 100644
index 00000000000..adc8a167830
--- /dev/null
+++ b/clang/test/CoverageMapping/debug-dir.cpp
@@ -0,0 +1,16 @@
+// %s expands to an absolute path, so to test relative paths we need to create a
+// clean directory, put the source there, and cd into it.
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/foobar
+// RUN: cd %t
+// RUN: cp %s foobar/debug-dir.cpp
+
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -main-file-name debug-dir.cpp foobar/debug-dir.cpp -o - | FileCheck -check-prefix=ABSOLUTE %s
+//
+// ABSOLUTE: @__llvm_coverage_mapping = {{.*"\\01.*clang.*test.*CoverageMapping.*.*foobar.*debug-dir\.cpp}}
+
+// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -emit-llvm -main-file-name debug-dir.cpp foobar/debug-dir.cpp -fdebug-compilation-dir . -o - | FileCheck -check-prefix=RELATIVE %s
+//
+// RELATIVE: @__llvm_coverage_mapping = {{.*"\\01[^/]*foobar.*debug-dir\.cpp}}
+
+void f1() {}
OpenPOWER on IntegriCloud