33 lines · plain
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.cpp3 4typedef unsigned long size_t;5 6typedef bool BOOL;7 8BOOL yes() {9 return __objc_yes;10}11 12BOOL no() {13 return __objc_no;14}15 16BOOL which (int flag) {17 return flag ? yes() : no();18}19 20int main() {21 which (__objc_yes);22 which (__objc_no);23 return __objc_yes;24}25 26void y(BOOL (^foo)());27 28void x() {29 y(^{30 return __objc_yes;31 });32}33