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