From 1ebb6f29ed1972665f35127efa907eabeb961cee Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Tue, 24 May 2011 00:22:40 +0000 Subject: [PATCH] Test case for r131940. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131941 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGenObjC/debug-info-blocks.m | 54 ++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 test/CodeGenObjC/debug-info-blocks.m diff --git a/test/CodeGenObjC/debug-info-blocks.m b/test/CodeGenObjC/debug-info-blocks.m new file mode 100644 index 0000000000..7054857026 --- /dev/null +++ b/test/CodeGenObjC/debug-info-blocks.m @@ -0,0 +1,54 @@ +// RUN: %clang_cc1 -masm-verbose -S -fblocks -g -triple x86_64-apple-darwin10 -fobjc-nonfragile-abi -fobjc-dispatch-method=mixed %s -o - | FileCheck %s + +//Radar 9279956 +//CHECK: ## DW_OP_deref +//CHECK-NEXT: ## DW_OP_plus_uconst + +typedef unsigned int NSUInteger; + +@protocol NSObject +@end + +@interface NSObject +- (id)init; ++ (id)alloc; +@end + +@interface NSDictionary : NSObject +- (NSUInteger)count; +@end + +@interface NSMutableDictionary : NSDictionary +@end + +@interface A : NSObject { +@public + int ivar; +} +@end + +static void run(void (^block)(void)) +{ + block(); +} + +@implementation A + +- (id)init +{ + if ((self = [super init])) { + run(^{ + NSMutableDictionary *d = [[NSMutableDictionary alloc] init]; + ivar = 42 + (int)[d count]; + }); + } + return self; +} + +@end + +int main() +{ + A *a = [[A alloc] init]; + return 0; +} -- 2.40.0