[ASan/Win] Add a comment about DCL-using-static vs threads
[blocksruntime.git] / test / msan / backtrace.cc
blob473e0ae8f88b70b09188cfb94083f60ac0f9e371
1 // RUN: %clangxx_msan -m64 -O0 %s -o %t && %run %t
3 #include <assert.h>
4 #include <execinfo.h>
5 #include <stdio.h>
6 #include <string.h>
7 #include <stdlib.h>
9 __attribute__((noinline))
10 void f() {
11 void *buf[10];
12 int sz = backtrace(buf, sizeof(buf) / sizeof(*buf));
13 assert(sz > 0);
14 for (int i = 0; i < sz; ++i)
15 if (!buf[i])
16 exit(1);
17 char **s = backtrace_symbols(buf, sz);
18 assert(s > 0);
19 for (int i = 0; i < sz; ++i)
20 printf("%d\n", strlen(s[i]));
23 int main(void) {
24 f();
25 return 0;