[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / AST / ast-dump-objc-arc-json.m
blob86ca28e283a5b6d9a74aad008fc43aa2e6a3603d
1 // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -x objective-c -fobjc-arc -ast-dump=json -ast-dump-filter Test %s | FileCheck %s
3 typedef struct {
4   id f;
5 } S;
7 id TestCompoundLiteral(id a) {
8   return ((S){ .f = a }).f;
11 // CHECK:  "kind": "ExprWithCleanups",
12 // CHECK-NEXT:  "range": {
13 // CHECK-NEXT:   "begin": {
14 // CHECK-NEXT:    "offset": {{[0-9]+}},
15 // CHECK-NEXT:    "col": 10,
16 // CHECK-NEXT:    "tokLen": 1
17 // CHECK-NEXT:   },
18 // CHECK-NEXT:   "end": {
19 // CHECK-NEXT:    "offset": {{[0-9]+}},
20 // CHECK-NEXT:    "col": 26,
21 // CHECK-NEXT:    "tokLen": 1
22 // CHECK-NEXT:   }
23 // CHECK-NEXT:  },
24 // CHECK-NEXT:  "type": {
25 // CHECK-NEXT:   "qualType": "id",
26 // CHECK-NEXT:   "typeAliasDeclId": "0x{{.*}}"
27 // CHECK-NEXT:  },
28 // CHECK-NEXT:  "valueCategory": "prvalue",
29 // CHECK-NEXT:  "cleanupsHaveSideEffects": true,
30 // CHECK-NEXT:  "cleanups": [
31 // CHECK-NEXT:   {
32 // CHECK-NEXT:    "id": "0x{{.*}}",
33 // CHECK-NEXT:    "kind": "CompoundLiteralExpr"
34 // CHECK-NEXT:   }
35 // CHECK-NEXT:  ],