summaryrefslogtreecommitdiff
path: root/test/Analysis/blocks.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/blocks.m')
-rw-r--r--test/Analysis/blocks.m22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Analysis/blocks.m b/test/Analysis/blocks.m
index 4dbe951720738..0b1c15abb3b3e 100644
--- a/test/Analysis/blocks.m
+++ b/test/Analysis/blocks.m
@@ -210,3 +210,25 @@ void testCallContainingWithSignature5()
});
}
+__attribute__((objc_root_class))
+@interface SuperClass
+- (void)someMethod;
+@end
+
+@interface SomeClass : SuperClass
+@end
+
+// Make sure to properly handle super-calls when a block captures
+// a local variable named 'self'.
+@implementation SomeClass
+-(void)foo; {
+ /*__weak*/ SomeClass *weakSelf = self;
+ (void)(^(void) {
+ SomeClass *self = weakSelf;
+ (void)(^(void) {
+ (void)self;
+ [super someMethod]; // no-warning
+ });
+ });
+}
+@end