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
5 // RUN: %run %t 2>&1 | FileCheck %s --implicit-check-not='ThreadSanitizer'
7 #include <dispatch/dispatch.h>
13 fprintf(stderr
,"Hello world");
15 dispatch_queue_t q
= dispatch_queue_create("my.queue", DISPATCH_QUEUE_SERIAL
);
28 dispatch_async(dispatch_get_main_queue(), ^{
29 fprintf(stderr
,"Done.");