2 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3 // See https://llvm.org/LICENSE.txt for license information.
4 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 #include <CoreFoundation/CoreFoundation.h>
8 #include <dispatch/dispatch.h>
10 //#import <Foundation/Foundation.h>
13 // CONFIG rdar://problem/6371811
15 const char *whoami
= "nobody";
17 void EnqueueStuff(dispatch_queue_t q
)
19 __block CFIndex counter
;
21 // above call has a side effect: it works around:
22 // <rdar://problem/6225809> __block variables not implicitly imported into intermediate scopes
29 //printf("outer block.\n");
32 //printf("inner block.\n");
35 printf("%s: success\n", whoami
);
40 printf("already done? inconceivable!\n");
46 int main (int argc
, const char * argv
[]) {
47 dispatch_queue_t q
= dispatch_queue_create("queue", NULL
);
54 printf("shouldn't get here\n");