Home | History | Annotate | Download | only in CodeGenObjC
      1 // RUN: %clang_cc1 -triple arm-apple-ios -emit-llvm -debug-info-kind=limited -fblocks  %s -o - | FileCheck %s
      2 // Objective-C code cargo-culted from debug-info-lifetime-crash.m.
      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 reference from inside the block implicitly creates another
     15   // local variable for the referenced member. That is what gets
     16   // suppressed by the attribute.  It still gets debug info as a
     17   // 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 @end
     27