[ASan/Win] Add a comment about DCL-using-static vs threads
[blocksruntime.git] / test / msan / print_stats.cc
blobbee364ba0d245cfd917d171238b0de04207b77d7
1 // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -m64 -g %s -o %t
2 // RUN: %run %t 2>&1 | \
3 // RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-NOSTATS %s
4 // RUN: MSAN_OPTIONS=print_stats=1 %run %t 2>&1 | \
5 // RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-NOSTATS %s
7 // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -m64 -g -DPOSITIVE=1 %s -o %t
8 // RUN: not %run %t 2>&1 | \
9 // RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-NOSTATS %s
10 // RUN: MSAN_OPTIONS=print_stats=1 not %run %t 2>&1 | \
11 // RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-STATS %s
13 // RUN: %clangxx_msan -fsanitize-memory-track-origins=2 -m64 -g -DPOSITIVE=1 -mllvm -msan-keep-going=1 %s -o %t
14 // RUN: not %run %t 2>&1 | \
15 // RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-NOSTATS --check-prefix=CHECK-KEEPGOING %s
16 // RUN: MSAN_OPTIONS=print_stats=1 not %run %t 2>&1 | \
17 // RUN: FileCheck --check-prefix=CHECK --check-prefix=CHECK-STATS --check-prefix=CHECK-KEEPGOING %s
19 #include <stdio.h>
20 int main(int argc, char **argv) {
21 int x;
22 int *volatile p = &x;
23 fprintf(stderr, "TEST\n");
24 #ifdef POSITIVE
25 return *p;
26 #else
27 return 0;
28 #endif
31 // CHECK: TEST
33 // CHECK-KEEPGOING: MemorySanitizer: 1 warnings reported.
35 // CHECK-STATS: Unique heap origins:
36 // CHECK-STATS: Stack depot allocated bytes:
37 // CHECK-STATS: Unique origin histories:
38 // CHECK-STATS: History depot allocated bytes:
40 // CHECK-NOSTATS-NOT: Unique heap origins:
41 // CHECK-NOSTATS-NOT: Stack depot allocated bytes:
42 // CHECK-NOSTATS-NOT: Unique origin histories:
43 // CHECK-NOSTATS-NOT: History depot allocated bytes: