aboutsummaryrefslogtreecommitdiff
path: root/test/profile/instrprof-gcov-exceptions.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/profile/instrprof-gcov-exceptions.test')
-rw-r--r--test/profile/instrprof-gcov-exceptions.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/profile/instrprof-gcov-exceptions.test b/test/profile/instrprof-gcov-exceptions.test
new file mode 100644
index 000000000000..20ca47a9528b
--- /dev/null
+++ b/test/profile/instrprof-gcov-exceptions.test
@@ -0,0 +1,21 @@
+RUN: mkdir -p %t.d
+RUN: cd %t.d
+
+# Test with exceptions disabled.
+RUN: %clangxx --coverage -o %t %S/Inputs/instrprof-gcov-exceptions.cpp -fno-exceptions
+RUN: test -f instrprof-gcov-exceptions.gcno
+
+RUN: rm -f instrprof-gcov-exceptions.gcda
+RUN: %run %t
+RUN: llvm-cov gcov instrprof-gcov-exceptions.gcda
+RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-gcov-exceptions.cpp.gcov %S/Inputs/instrprof-gcov-exceptions.cpp.gcov
+
+# Test with exceptions enabled, the result in terms of line counts should be the same.
+RUN: %clangxx --coverage -o %t %S/Inputs/instrprof-gcov-exceptions.cpp
+RUN: test -f instrprof-gcov-exceptions.gcno
+
+RUN: rm -f instrprof-gcov-exceptions.gcda
+RUN: %run %t
+RUN: llvm-cov gcov instrprof-gcov-exceptions.gcda
+# The result should be the same, not using XFAIL as only this part of the test is failing.
+RUN: not FileCheck --match-full-lines --strict-whitespace --input-file instrprof-gcov-exceptions.cpp.gcov %S/Inputs/instrprof-gcov-exceptions.cpp.gcov