From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/CodeGenObjC/debug-info-blocks.m | 55 ++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 clang/test/CodeGenObjC/debug-info-blocks.m (limited to 'clang/test/CodeGenObjC/debug-info-blocks.m') diff --git a/clang/test/CodeGenObjC/debug-info-blocks.m b/clang/test/CodeGenObjC/debug-info-blocks.m new file mode 100644 index 0000000..71ae8a6 --- /dev/null +++ b/clang/test/CodeGenObjC/debug-info-blocks.m @@ -0,0 +1,55 @@ +// REQUIRES: x86-64-registered-target +// RUN: %clang_cc1 -masm-verbose -S -fblocks -g -triple x86_64-apple-darwin10 -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; +} -- cgit v1.2.3