1 // RUN: %clang_analyze_cc1 -w -fblocks %s \
2 // RUN: -analyzer-checker=debug.DumpLiveExprs \
3 // RUN: 2>&1 | FileCheck %s
13 typedef void (^Blk)();
19 RAII(Blk blk): blk(blk) {}
21 // CHECK: [ B0 (live expressions at block exit) ]
24 // CHECK-NEXT: [ B1 (live expressions at block exit) ]
27 // CHECK-NEXT: [ B2 (live expressions at block exit) ]
33 // CHECK-NEXT: [ B0 (live expressions at block exit) ]
36 // CHECK-NEXT: [ B1 (live expressions at block exit) ]
39 // CHECK-NEXT: [ B2 (live expressions at block exit) ]
44 void foo(Collection *coll) {
46 for (Item *item in coll) {}
48 // CHECK-NEXT: [ B0 (live expressions at block exit) ]
51 // CHECK-NEXT: [ B1 (live expressions at block exit) ]
54 // CHECK-NEXT: [ B2 (live expressions at block exit) ]
56 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'Collection *' <LValueToRValue>
57 // CHECK-NEXT: `-DeclRefExpr {{.*}} 'Collection *' lvalue ParmVar {{.*}} 'coll' 'Collection *'
60 // CHECK-NEXT: [ B3 (live expressions at block exit) ]
62 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'Collection *' <LValueToRValue>
63 // CHECK-NEXT: `-DeclRefExpr {{.*}} 'Collection *' lvalue ParmVar {{.*}} 'coll' 'Collection *'
66 // CHECK-NEXT: [ B4 (live expressions at block exit) ]
68 // CHECK-NEXT: ImplicitCastExpr {{.*}} 'Collection *' <LValueToRValue>
69 // CHECK-NEXT: `-DeclRefExpr {{.*}} 'Collection *' lvalue ParmVar {{.*}} 'coll' 'Collection *'
72 // CHECK-NEXT: [ B5 (live expressions at block exit) ]
75 // CHECK-NEXT: [ B0 (live expressions at block exit) ]
78 // CHECK-NEXT: [ B1 (live expressions at block exit) ]