blob: 7aaa79b1e943fb8492e435fcb1b5833ca32c17d3 [file] [log] [blame]
Fariborz Jahanian99850382012-04-12 17:49:18 +00001// 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// rdar://11231426
4
Fariborz Jahanian8b08adb2012-05-03 21:44:12 +00005// rdar://11375908
6typedef unsigned long size_t;
7
Fariborz Jahanian99850382012-04-12 17:49:18 +00008typedef bool BOOL;
9
10BOOL yes() {
11 return __objc_yes;
12}
13
14BOOL no() {
15 return __objc_no;
16}
17
18BOOL which (int flag) {
19 return flag ? yes() : no();
20}
21
22int main() {
23 which (__objc_yes);
24 which (__objc_no);
25 return __objc_yes;
26}
27
28void y(BOOL (^foo)());
29
30void x() {
31 y(^{
32 return __objc_yes;
33 });
34}