| 1 |
// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp |
| 2 |
// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"__declspec(X)=" %t-rw.cpp |
| 3 |
|
| 4 |
typedef unsigned long size_t; |
| 5 |
|
| 6 |
typedef bool BOOL; |
| 7 |
|
| 8 |
BOOL yes() { |
| 9 |
return __objc_yes; |
| 10 |
} |
| 11 |
|
| 12 |
BOOL no() { |
| 13 |
return __objc_no; |
| 14 |
} |
| 15 |
|
| 16 |
BOOL which (int flag) { |
| 17 |
return flag ? yes() : no(); |
| 18 |
} |
| 19 |
|
| 20 |
int main() { |
| 21 |
which (__objc_yes); |
| 22 |
which (__objc_no); |
| 23 |
return __objc_yes; |
| 24 |
} |
| 25 |
|
| 26 |
void y(BOOL (^foo)()); |
| 27 |
|
| 28 |
void x() { |
| 29 |
y(^{ |
| 30 |
return __objc_yes; |
| 31 |
}); |
| 32 |
} |