brintos

brintos / llvm-project-archived public Read only

0
0
Text · 850 B · 42d630b Raw
27 lines · plain
1// RUN: %clang_cc1 -triple arm-apple-ios -emit-llvm -debug-info-kind=limited -fblocks  %s -o - | FileCheck %s2// Objective-C code cargo-culted from debug-info-lifetime-crash.m.3@protocol NSObject4- (id)copy;5@end6@class W;7@interface View18@end9@implementation Controller {10    void (^Block)(void);11}12- (void)View:(View1 *)View foo:(W *)W13{14  // The reference from inside the block implicitly creates another15  // local variable for the referenced member. That is what gets16  // suppressed by the attribute.  It still gets debug info as a17  // member, though.18  // CHECK-NOT: !DILocalVariable(name: "weakSelf"19  // CHECK:     !DIDerivedType({{.*}} name: "weakSelf"20  // CHECK-NOT: !DILocalVariable(name: "weakSelf"21  __attribute__((nodebug)) __typeof(self) weakSelf = self;22  Block = [^{23    __typeof(self) strongSelf = weakSelf;24    } copy];25}26@end27