summaryrefslogtreecommitdiff
path: root/test/tools/llvm-cov/double_dots.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/tools/llvm-cov/double_dots.c')
-rw-r--r--test/tools/llvm-cov/double_dots.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/tools/llvm-cov/double_dots.c b/test/tools/llvm-cov/double_dots.c
new file mode 100644
index 0000000000000..2c79a6ecf6163
--- /dev/null
+++ b/test/tools/llvm-cov/double_dots.c
@@ -0,0 +1,22 @@
+// To create the covmapping for this file, copy this file to /tmp/dots/,
+// cd into /tmp/dots, and pass "../dots/double_dots.c" to the compiler. Use
+// llvm-cov convert-for-testing to extract the covmapping.
+
+// RUN: llvm-profdata merge %S/Inputs/double_dots.proftext -o %t.profdata
+// RUN: llvm-cov show %S/Inputs/double_dots.covmapping -instr-profile=%t.profdata -o %t.dir
+// RUN: FileCheck -input-file=%t.dir/index.txt %s
+
+// CHECK-NOT: coverage{{.*}}dots{{.*}}..{{.*}}dots
+
+int main() {}
+
+// Re-purpose this file to test that we use relative paths when creating
+// report indices:
+
+// RUN: FileCheck -check-prefix=REL-INDEX -input-file %t.dir/index.txt %s
+// REL-INDEX-NOT: %t.dir
+
+// Check that we get the right error when writing to an invalid path:
+
+// RUN: not llvm-cov show %S/Inputs/double_dots.covmapping -instr-profile=%t.profdata -o /dev/null 2>&1 | FileCheck %s -check-prefix=ERROR-MESSAGE
+// ERROR-MESSAGE: error: {{.*}}: Could not create index file!