]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/asan/TestCases/Windows/coverage-basic.cc
Vendor import of compiler-rt trunk r351319 (just before the release_80
[FreeBSD/FreeBSD.git] / test / asan / TestCases / Windows / coverage-basic.cc
1 // RUN: rm -rf %t-dir
2 // RUN: mkdir %t-dir && cd %t-dir
3 // RUN: %clangxx_asan -fsanitize-coverage=func %s -o test.exe
4 // RUN: %env_asan_opts=coverage=1 %run ./test.exe
5 //
6 // RUN: %sancov print *.sancov | FileCheck %s
7 #include <stdio.h>
8
9 void foo() { fputs("FOO", stderr); }
10 void bar() { fputs("BAR", stderr); }
11
12 int main(int argc, char **argv) {
13   if (argc == 2) {
14     foo();
15     bar();
16   } else {
17     bar();
18     foo();
19   }
20 }
21
22 // CHECK: 0x{{[0-9a-f]*}}
23 // CHECK: 0x{{[0-9a-f]*}}
24 // CHECK: 0x{{[0-9a-f]*}}
25 // CHECK-NOT: 0x{{[0-9a-f]*}}