summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenObjC')
-rw-r--r--clang/test/CodeGenObjC/debug-info-nodebug.m26
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/debug-info-nodebug.m b/clang/test/CodeGenObjC/debug-info-nodebug.m
new file mode 100644
index 00000000000..42d630b4ac1
--- /dev/null
+++ b/clang/test/CodeGenObjC/debug-info-nodebug.m
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -triple arm-apple-ios -emit-llvm -debug-info-kind=limited -fblocks %s -o - | FileCheck %s
+// Objective-C code cargo-culted from debug-info-lifetime-crash.m.
+@protocol NSObject
+- (id)copy;
+@end
+@class W;
+@interface View1
+@end
+@implementation Controller {
+ void (^Block)(void);
+}
+- (void)View:(View1 *)View foo:(W *)W
+{
+ // The reference from inside the block implicitly creates another
+ // local variable for the referenced member. That is what gets
+ // suppressed by the attribute. It still gets debug info as a
+ // member, though.
+ // CHECK-NOT: !DILocalVariable(name: "weakSelf"
+ // CHECK: !DIDerivedType({{.*}} name: "weakSelf"
+ // CHECK-NOT: !DILocalVariable(name: "weakSelf"
+ __attribute__((nodebug)) __typeof(self) weakSelf = self;
+ Block = [^{
+ __typeof(self) strongSelf = weakSelf;
+ } copy];
+}
+@end
OpenPOWER on IntegriCloud