1 // RUN: %clang_tsan %s -o %t -framework Foundation
2 // RUN: %run %t 2>&1 | FileCheck %s
4 #import <Foundation/Foundation.h>
9 NSLog(@"Hello world.");
13 dispatch_semaphore_t sem = dispatch_semaphore_create(0);
14 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
17 dispatch_semaphore_signal(sem);
20 dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
27 // CHECK: Hello world.
29 // CHECK-NOT: WARNING: ThreadSanitizer