| // RUN: %clang_tsan %s -o %t -framework Foundation |
| // RUN: %run %t 2>&1 | FileCheck %s |
| #import <Foundation/Foundation.h> |
| void notify_callback(void *context) { |
| dispatch_queue_t q = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); |
| for (int i = 0; i < 300000; i++) { |
| dispatch_group_t g = dispatch_group_create(); |
| dispatch_group_notify(g, q, ^{ |
| for (int i = 0; i < 300000; i++) { |
| dispatch_group_t g = dispatch_group_create(); |
| dispatch_group_notify_f(g, q, NULL, ¬ify_callback); |
| // CHECK-NOT: WARNING: ThreadSanitizer |
| // CHECK-NOT: CHECK failed |