1 // RUN: %clangxx_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
6 typedef int32_t OSSpinLock
;
7 extern "C" void OSSpinLockLock(OSSpinLock
*);
8 extern "C" void OSSpinLockUnlock(OSSpinLock
*);
13 void *Thread(void *x
) {
14 OSSpinLockLock(&lock
);
16 OSSpinLockUnlock(&lock
);
21 fprintf(stderr
, "Hello world.\n");
24 pthread_create(&t
[0], NULL
, Thread
, NULL
);
25 pthread_create(&t
[1], NULL
, Thread
, NULL
);
26 pthread_join(t
[0], NULL
);
27 pthread_join(t
[1], NULL
);
29 fprintf(stderr
, "Done.\n");
32 // CHECK: Hello world.
34 // CHECK-NOT: WARNING: ThreadSanitizer