Galina Kistanova | 0ccb31c | 2011-06-03 22:24:54 +0000 | [diff] [blame] | 1 | // REQUIRES: x86-64-registered-target |
John McCall | d1e40d5 | 2011-10-02 01:16:38 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -masm-verbose -S -fblocks -g -triple x86_64-apple-darwin10 -fobjc-dispatch-method=mixed %s -o - | FileCheck %s |
Devang Patel | 1ebb6f29 | 2011-05-24 00:22:40 +0000 | [diff] [blame] | 3 | |
| 4 | //Radar 9279956 |
| 5 | //CHECK: ## DW_OP_deref |
| 6 | //CHECK-NEXT: ## DW_OP_plus_uconst |
| 7 | |
| 8 | typedef unsigned int NSUInteger; |
| 9 | |
| 10 | @protocol NSObject |
| 11 | @end |
| 12 | |
| 13 | @interface NSObject <NSObject> |
| 14 | - (id)init; |
| 15 | + (id)alloc; |
| 16 | @end |
| 17 | |
| 18 | @interface NSDictionary : NSObject |
| 19 | - (NSUInteger)count; |
| 20 | @end |
| 21 | |
| 22 | @interface NSMutableDictionary : NSDictionary |
| 23 | @end |
| 24 | |
| 25 | @interface A : NSObject { |
| 26 | @public |
| 27 | int ivar; |
| 28 | } |
| 29 | @end |
| 30 | |
| 31 | static void run(void (^block)(void)) |
| 32 | { |
| 33 | block(); |
| 34 | } |
| 35 | |
| 36 | @implementation A |
| 37 | |
| 38 | - (id)init |
| 39 | { |
| 40 | if ((self = [super init])) { |
| 41 | run(^{ |
| 42 | NSMutableDictionary *d = [[NSMutableDictionary alloc] init]; |
| 43 | ivar = 42 + (int)[d count]; |
| 44 | }); |
| 45 | } |
| 46 | return self; |
| 47 | } |
| 48 | |
| 49 | @end |
| 50 | |
| 51 | int main() |
| 52 | { |
| 53 | A *a = [[A alloc] init]; |
| 54 | return 0; |
| 55 | } |