[Sanitizer] Add rudimentary support for wide-character strings to scanf/printf interc...
[blocksruntime.git] / test / tsan / tiny_race.c
blobf77e1606c1dd2c2c25ba56fdcdf27f382e76af6c
1 // RUN: %clang_tsan -O1 %s -o %t && not %t 2>&1 | FileCheck %s
2 #include <pthread.h>
3 #include <unistd.h>
5 int Global;
7 void *Thread1(void *x) {
8 sleep(1);
9 Global = 42;
10 return x;
13 int main() {
14 pthread_t t;
15 pthread_create(&t, 0, Thread1, 0);
16 Global = 43;
17 pthread_join(t, 0);
18 return Global;
21 // CHECK: WARNING: ThreadSanitizer: data race