1 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
16 Cache
*CreateCache() {
18 return new Cache(rand());
21 void *Thread1(void *x
) {
22 static Cache
*c
= CreateCache();
30 pthread_create(&t
[0], 0, Thread1
, 0);
31 pthread_create(&t
[1], 0, Thread1
, 0);
32 pthread_join(t
[0], 0);
33 pthread_join(t
[1], 0);
34 fprintf(stderr
, "PASS\n");
37 // CHECK-NOT: WARNING: ThreadSanitizer: data race