diff options
author | Zancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au> | 2012-09-24 09:58:17 +1000 |
---|---|---|
committer | Zancanaro; Carlo <czan8762@plang3.cs.usyd.edu.au> | 2012-09-24 09:58:17 +1000 |
commit | 222e2a7620e6520ffaf4fc4e69d79c18da31542e (patch) | |
tree | 7bfbc05bfa3b41c8f9d2e56d53a0bc3e310df239 /clang/test/Rewriter/rewrite-captured-nested-bvar.c | |
parent | 3d206f03985b50beacae843d880bccdc91a9f424 (diff) |
Add the clang library to the repo (with some of my changes, too).
Diffstat (limited to 'clang/test/Rewriter/rewrite-captured-nested-bvar.c')
-rw-r--r-- | clang/test/Rewriter/rewrite-captured-nested-bvar.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/clang/test/Rewriter/rewrite-captured-nested-bvar.c b/clang/test/Rewriter/rewrite-captured-nested-bvar.c new file mode 100644 index 0000000..a48de4b --- /dev/null +++ b/clang/test/Rewriter/rewrite-captured-nested-bvar.c @@ -0,0 +1,35 @@ +// RUN: %clang_cc1 -x c -fblocks -fms-extensions -rewrite-objc %s -o %t-rw.cpp +// RUN: FileCheck --input-file=%t-rw.cpp %s +// rdar://9006279 + +void q(void (^p)(void)) { + p(); +} + +void f() { + __block char BYREF_VAR_CHECK = 'a'; + __block char d = 'd'; + q(^{ + q(^{ + __block char e = 'e'; + char l = 'l'; + BYREF_VAR_CHECK = 'b'; + d = 'd'; + q(^{ + e = '1'; + BYREF_VAR_CHECK = '2'; + d = '3'; + } + ); + }); + }); +} + +int main() { + f(); + return 0; +} + +// CHECK 2: (__Block_byref_BYREF_VAR_CHECK_0 *)BYREF_VAR_CHECK +// CHECK: (__Block_byref_BYREF_VAR_CHECK_0 *)&BYREF_VAR_CHECK +// CHECK: (struct __Block_byref_BYREF_VAR_CHECK_0 *)&BYREF_VAR_CHECK, (struct __Block_byref_d_1 *)&d, 570425344)); |