1 // Check that we don't crash when dispatch_main calls pthread_exit which
2 // quits the main thread.
4 // RUN: %clang_tsan %s -o %t -framework Foundation
5 // RUN: %env_tsan_opts=ignore_interceptors_accesses=1 %run %t 2>&1 | FileCheck %s
7 #import <Foundation/Foundation.h>
10 fprintf(stderr,"Hello world");
12 dispatch_queue_t q = dispatch_queue_create("my.queue", DISPATCH_QUEUE_SERIAL);
25 dispatch_async(dispatch_get_main_queue(), ^{
26 fprintf(stderr,"Done.");
37 // CHECK-NOT: WARNING: ThreadSanitizer
38 // CHECK-NOT: CHECK failed