1 // RUN: %clang_tsan %s -o %t
2 // RUN: %run %t 2>&1 | FileCheck %s --implicit-check-not='ThreadSanitizer'
4 #include <dispatch/dispatch.h>
11 fprintf(stderr
, "Hello world.");
15 dispatch_semaphore_t sem
= dispatch_semaphore_create(0);
16 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT
, 0), ^{
19 dispatch_semaphore_signal(sem
);
22 dispatch_semaphore_wait(sem
, DISPATCH_TIME_FOREVER
);
25 fprintf(stderr
, "Done.");
29 // CHECK: Hello world.