[ASan/Win] Add a comment about DCL-using-static vs threads
[blocksruntime.git] / test / msan / c-strdup.c
blob059300e4205ab8d31c99dd16dbcca2d0460aca37
1 // RUN: %clang_msan -m64 -O0 %s -o %t && %run %t >%t.out 2>&1
2 // RUN: %clang_msan -m64 -O1 %s -o %t && %run %t >%t.out 2>&1
3 // RUN: %clang_msan -m64 -O2 %s -o %t && %run %t >%t.out 2>&1
4 // RUN: %clang_msan -m64 -O3 %s -o %t && %run %t >%t.out 2>&1
6 // Test that strdup in C programs is intercepted.
7 // GLibC headers translate strdup to __strdup at -O1 and higher.
9 #include <stdlib.h>
10 #include <string.h>
11 int main(int argc, char **argv) {
12 char buf[] = "abc";
13 char *p = strdup(buf);
14 if (*p)
15 exit(0);
16 return 0;