1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc -fobjc-runtime=macosx-fragile-10.5 %s -o %t-rw.cpp 2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -fblocks -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-rw.cpp 3*f4a2713aSLionel Sambuc// grep "static void __FUNC_block_copy_" %t-rw.cpp | count 2 4*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -Wno-return-type -fblocks -fms-extensions -rewrite-objc %s -o %t-modern-rw.cpp 5*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -Wno-address-of-temporary -D"id=void*" -D"SEL=void*" -D"__declspec(X)=" %t-modern-rw.cpp 6*f4a2713aSLionel Sambuc// grep "static void __FUNC_block_copy_" %t-modern-rw.cpp | count 2 7*f4a2713aSLionel Sambuc// rdar://8499592 8*f4a2713aSLionel Sambuc 9*f4a2713aSLionel Sambuctypedef unsigned long size_t; 10*f4a2713aSLionel Sambucvoid Outer(void (^bk)()); 11*f4a2713aSLionel Sambucvoid Inner(void (^bk)()); 12*f4a2713aSLionel Sambucvoid INNER_FUNC(id d); 13*f4a2713aSLionel Sambuc 14*f4a2713aSLionel Sambucvoid FUNC() { 15*f4a2713aSLionel Sambuc 16*f4a2713aSLionel Sambuc id bar = (id)42; 17*f4a2713aSLionel Sambuc Outer(^{ 18*f4a2713aSLionel Sambuc Inner(^{ 19*f4a2713aSLionel Sambuc INNER_FUNC(bar); 20*f4a2713aSLionel Sambuc }); 21*f4a2713aSLionel Sambuc }); 22*f4a2713aSLionel Sambuc} 23