1 // RUN: %clang_tsan %s -o %t -framework Foundation
2 // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s
4 #import <Foundation/Foundation.h>
8 static const long nIter = 1000;
11 NSLog(@"Hello world.");
14 for (int i = 0; i < nIter; i++) {
15 dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
16 dispatch_sync(dispatch_get_main_queue(), ^{
20 CFRunLoopStop(CFRunLoopGetCurrent());
30 // CHECK: Hello world.
32 // CHECK-NOT: WARNING: ThreadSanitizer