Fariborz Jahanian | df407c3 | 2012-04-25 20:48:00 +0000 | [diff] [blame] | 1 | // 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 | |
| 5 | void q(void (^p)(void)) { |
| 6 | p(); |
| 7 | } |
| 8 | |
| 9 | void 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 | |
| 28 | int main() { |
| 29 | f(); |
| 30 | return 0; |
| 31 | } |
| 32 | |
Pirama Arumuga Nainar | 3ea9e33 | 2015-04-08 08:57:32 -0700 | [diff] [blame] | 33 | // CHECK: (__Block_byref_BYREF_VAR_CHECK_0 *)BYREF_VAR_CHECK |
Fariborz Jahanian | df407c3 | 2012-04-25 20:48:00 +0000 | [diff] [blame] | 34 | // CHECK: {(void*)0,(__Block_byref_BYREF_VAR_CHECK_0 *)&BYREF_VAR_CHECK, 0, sizeof(__Block_byref_BYREF_VAR_CHECK_0), 'a'} |
Stephen Hines | 176edba | 2014-12-01 14:53:08 -0800 | [diff] [blame] | 35 | // CHECK: __Block_byref_BYREF_VAR_CHECK_0 *)&BYREF_VAR_CHECK, (__Block_byref_d_1 *)&d, 570425344))); |