1 // RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp
2 // RUN: FileCheck -check-prefix CHECK-LP --input-file=%t-rw.cpp %s
5 extern "C" void *_Block_copy(const void *aBlock);
6 extern "C" void _Block_release(const void *aBlock);
10 __attribute__((__blocks__(byref))) int a = 42;
14 ((__typeof(^{ a = 2; }))_Block_copy((const void *)(^{ a = 2; })));
17 ((__typeof(b))_Block_copy((const void *)(b)));
22 // CHECK-LP: ((void (^)(void))_Block_copy((const void *)(b)))
26 __typeof__(a) aVal = a;
27 char *a1t = (char *)@encode(__typeof__(a));
28 __typeof__(aVal) bVal;
29 char *a2t = (char *)@encode(__typeof__(bVal));
30 __typeof__(bVal) cVal = bVal;
31 char *a3t = (char *)@encode(__typeof__(cVal));
36 // CHECK-LP: int aVal = a;
38 // CHECK-LP: int bVal;