Mike Stump | f33651c | 2009-04-14 00:57:29 +0000 | [diff] [blame^] | 1 | // RUN: clang-cc %s -emit-llvm -o %t -fobjc-gc -fblocks && |
| 2 | // RUN: grep "_Block_object_dispose" %t | count 4 && |
Mike Stump | c0c0ef0 | 2009-04-10 23:09:55 +0000 | [diff] [blame] | 3 | // RUN: grep "__copy_helper_block_" %t | count 2 && |
| 4 | // RUN: grep "__destroy_helper_block_" %t | count 2 && |
Mike Stump | f33651c | 2009-04-14 00:57:29 +0000 | [diff] [blame^] | 5 | // RUN: grep "__Block_byref_id_object_copy_" %t | count 2 && |
| 6 | // RUN: grep "__Block_byref_id_object_dispose_" %t | count 2 && |
Mike Stump | c0c0ef0 | 2009-04-10 23:09:55 +0000 | [diff] [blame] | 7 | // RUN: grep "i32 135)" %t | count 0 && |
Mike Stump | f33651c | 2009-04-14 00:57:29 +0000 | [diff] [blame^] | 8 | // RUN: grep "_Block_object_assign" %t | count 3 && |
| 9 | // RUN: grep "objc_read_weak" %t | count 2 && |
| 10 | // RUN: grep "objc_assign_weak" %t | count 2 |
Mike Stump | c0c0ef0 | 2009-04-10 23:09:55 +0000 | [diff] [blame] | 11 | |
| 12 | @interface NSDictionary @end |
| 13 | |
| 14 | void test1(NSDictionary * dict) { |
| 15 | ^{ (void)dict; }(); |
| 16 | } |
Mike Stump | f33651c | 2009-04-14 00:57:29 +0000 | [diff] [blame^] | 17 | |
| 18 | @interface D |
| 19 | @end |
| 20 | |
| 21 | void foo() { |
| 22 | __block __weak D *weakSelf; |
| 23 | D *l; |
| 24 | l = weakSelf; |
| 25 | weakSelf = l; |
| 26 | } |