xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenObjC/debug-info-lifetime-crash.m (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1// RUN: %clang_cc1 -triple arm-apple-ios -emit-llvm -g -fblocks -fobjc-runtime=ios-7.0.0 -fobjc-arc %s -o - | FileCheck %s
2// rdar://problem/14990656
3@protocol NSObject
4- (id)copy;
5@end
6@class W;
7@interface View1
8@end
9@implementation Controller {
10    void (^Block)(void);
11}
12- (void)View:(View1 *)View foo:(W *)W
13{
14  // The debug type for these two will be identical, because we do not
15  // actually emit the ownership qualifier.
16  // CHECK-DAG:  !"0x100\00weakSelf\00[[@LINE+1]]\000"{{, [^,]+, [^,]+}}, ![[SELFTY:[0-9]+]]} ; [ DW_TAG_auto_variable ] [weakSelf]
17  __attribute__((objc_ownership(weak))) __typeof(self) weakSelf = self;
18  Block = [^{
19  // CHECK-DAG:  !"0x100\00strongSelf\00[[@LINE+1]]\000"{{, [^,]+, [^,]+}}, ![[SELFTY]]} ; [ DW_TAG_auto_variable ] [strongSelf]
20      __attribute__((objc_ownership(strong))) __typeof(self) strongSelf = weakSelf;
21    } copy];
22}
23@end
24