blob: d1457dc76d2614908961a393020aeb6df8076ad1 [file] [log] [blame]
Fariborz Jahaniandf407c32012-04-25 20:48:00 +00001// RUN: %clang_cc1 -E %s -o %t.mm
2// RUN: %clang_cc1 -x objective-c++ -fblocks -fms-extensions -rewrite-objc %t.mm -o - | FileCheck %s
3// rdar://9006279
4
5void q(void (^p)(void)) {
6 p();
7}
8
9void f() {
10 __block char BYREF_VAR_CHECK = 'a';
11 __block char d = 'd';
12 q(^{
13 q(^{
14 __block char e = 'e';
15 char l = 'l';
16 BYREF_VAR_CHECK = 'b';
17 d = 'd';
18 q(^{
19 e = '1';
20 BYREF_VAR_CHECK = '2';
21 d = '3';
22 }
23 );
24 });
25 });
26}
27
28int main() {
29 f();
30 return 0;
31}
32
Pirama Arumuga Nainar3ea9e332015-04-08 08:57:32 -070033// CHECK: (__Block_byref_BYREF_VAR_CHECK_0 *)BYREF_VAR_CHECK
Fariborz Jahaniandf407c32012-04-25 20:48:00 +000034// CHECK: {(void*)0,(__Block_byref_BYREF_VAR_CHECK_0 *)&BYREF_VAR_CHECK, 0, sizeof(__Block_byref_BYREF_VAR_CHECK_0), 'a'}
Stephen Hines176edba2014-12-01 14:53:08 -080035// CHECK: __Block_byref_BYREF_VAR_CHECK_0 *)&BYREF_VAR_CHECK, (__Block_byref_d_1 *)&d, 570425344)));