1 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
2 // Regtest for https://github.com/google/sanitizers/issues/447
3 // This is a correct program and tsan should not report a race.
7 __attribute__((noinline
))
14 void *Thread1(void *p
) {
15 barrier_wait(&barrier
);
16 long res
= foo((long)p
);
21 barrier_init(&barrier
, 2);
23 pthread_create(&t
, 0, Thread1
, 0);
25 barrier_wait(&barrier
);
27 fprintf(stderr
, "PASS\n");
28 // CHECK-NOT: ThreadSanitizer: data race