diff options
Diffstat (limited to 'compiler-rt/test/asan/TestCases/Windows/coverage-basic.cpp')
-rw-r--r-- | compiler-rt/test/asan/TestCases/Windows/coverage-basic.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/compiler-rt/test/asan/TestCases/Windows/coverage-basic.cpp b/compiler-rt/test/asan/TestCases/Windows/coverage-basic.cpp new file mode 100644 index 00000000000..1469e1c30ae --- /dev/null +++ b/compiler-rt/test/asan/TestCases/Windows/coverage-basic.cpp @@ -0,0 +1,25 @@ +// RUN: rm -rf %t-dir +// RUN: mkdir %t-dir && cd %t-dir +// RUN: %clangxx_asan -fsanitize-coverage=func %s -o test.exe +// RUN: %env_asan_opts=coverage=1 %run ./test.exe +// +// RUN: %sancov print *.sancov | FileCheck %s +#include <stdio.h> + +void foo() { fputs("FOO", stderr); } +void bar() { fputs("BAR", stderr); } + +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]*}} |