aboutsummaryrefslogtreecommitdiff
path: root/test/asan/TestCases/Windows/coverage-basic.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/asan/TestCases/Windows/coverage-basic.cc')
-rw-r--r--test/asan/TestCases/Windows/coverage-basic.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/asan/TestCases/Windows/coverage-basic.cc b/test/asan/TestCases/Windows/coverage-basic.cc
new file mode 100644
index 000000000000..44b499fcb4cd
--- /dev/null
+++ b/test/asan/TestCases/Windows/coverage-basic.cc
@@ -0,0 +1,25 @@
+// RUN: rm -rf %T/coverage-basic
+// RUN: mkdir %T/coverage-basic && cd %T/coverage-basic
+// RUN: %clangxx_asan -fsanitize-coverage=func %s -o test.exe
+// RUN: env ASAN_OPTIONS=coverage=1 %run ./test.exe
+//
+// RUN: %sancov print *.sancov | FileCheck %s
+#include <stdio.h>
+
+void foo() { fprintf(stderr, "FOO\n"); }
+void bar() { fprintf(stderr, "BAR\n"); }
+
+int main(int argc, char **argv) {
+ if (argc == 2) {
+ foo();
+ bar();
+ } else {
+ bar();
+ foo();
+ }
+}
+
+// CHECK: 0x{{[0-9a-f]*}}
+// CHECK: 0x{{[0-9a-f]*}}
+// CHECK: 0x{{[0-9a-f]*}}
+// CHECK-NOT: 0x{{[0-9a-f]*}}