aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGenObjC/debug-info-blocks.m
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-05-24 00:22:40 +0000
committerDevang Patel <dpatel@apple.com>2011-05-24 00:22:40 +0000
commit433a11b95a49d85618bc4ad47ff6cc8bf7eb3875 (patch)
tree49fb9cd94929918c3651b35eedfac6a845e7097c /clang/test/CodeGenObjC/debug-info-blocks.m
parent354fa0798fe4023b98ba33d556925d895431afbd (diff)
downloadllvm-433a11b95a49d85618bc4ad47ff6cc8bf7eb3875.zip
llvm-433a11b95a49d85618bc4ad47ff6cc8bf7eb3875.tar.gz
llvm-433a11b95a49d85618bc4ad47ff6cc8bf7eb3875.tar.bz2
Test case for r131940.
llvm-svn: 131941
Diffstat (limited to 'clang/test/CodeGenObjC/debug-info-blocks.m')
-rw-r--r--clang/test/CodeGenObjC/debug-info-blocks.m54
1 files changed, 54 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/debug-info-blocks.m b/clang/test/CodeGenObjC/debug-info-blocks.m
new file mode 100644
index 0000000..70548570
--- /dev/null
+++ b/clang/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 <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;
+}