1 // RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -ast-dump=json %s | FileCheck %s
2 
implicitcast_0(unsigned int x)3 unsigned char implicitcast_0(unsigned int x) {
4   return x;
5 }
6 
implicitcast_1(unsigned int x)7 signed char implicitcast_1(unsigned int x) {
8   return x;
9 }
10 
implicitcast_2(signed int x)11 unsigned char implicitcast_2(signed int x) {
12   return x;
13 }
14 
implicitcast_3(signed int x)15 signed char implicitcast_3(signed int x) {
16   return x;
17 }
18 
19 //----------------------------------------------------------------------------//
20 
cstylecast_0(unsigned int x)21 unsigned char cstylecast_0(unsigned int x) {
22   return (unsigned char)x;
23 }
24 
cstylecast_1(unsigned int x)25 signed char cstylecast_1(unsigned int x) {
26   return (signed char)x;
27 }
28 
cstylecast_2(signed int x)29 unsigned char cstylecast_2(signed int x) {
30   return (unsigned char)x;
31 }
32 
cstylecast_3(signed int x)33 signed char cstylecast_3(signed int x) {
34   return (signed char)x;
35 }
36 
37 // NOTE: CHECK lines have been autogenerated by gen_ast_dump_json_test.py
38 // using --filters=ImplicitCastExpr,CStyleCastExpr
39 
40 
41 // CHECK:  "kind": "ImplicitCastExpr",
42 // CHECK-NEXT:  "range": {
43 // CHECK-NEXT:   "begin": {
44 // CHECK-NEXT:    "offset": 148,
45 // CHECK-NEXT:    "col": 10,
46 // CHECK-NEXT:    "tokLen": 1
47 // CHECK-NEXT:   },
48 // CHECK-NEXT:   "end": {
49 // CHECK-NEXT:    "offset": 148,
50 // CHECK-NEXT:    "col": 10,
51 // CHECK-NEXT:    "tokLen": 1
52 // CHECK-NEXT:   }
53 // CHECK-NEXT:  },
54 // CHECK-NEXT:  "type": {
55 // CHECK-NEXT:   "qualType": "unsigned char"
56 // CHECK-NEXT:  },
57 // CHECK-NEXT:  "valueCategory": "rvalue",
58 // CHECK-NEXT:  "castKind": "IntegralCast",
59 // CHECK-NEXT:  "inner": [
60 // CHECK-NEXT:   {
61 // CHECK-NEXT:    "id": "0x{{.*}}",
62 // CHECK-NEXT:    "kind": "ImplicitCastExpr",
63 // CHECK-NEXT:    "range": {
64 // CHECK-NEXT:     "begin": {
65 // CHECK-NEXT:      "offset": 148,
66 // CHECK-NEXT:      "col": 10,
67 // CHECK-NEXT:      "tokLen": 1
68 // CHECK-NEXT:     },
69 // CHECK-NEXT:     "end": {
70 // CHECK-NEXT:      "offset": 148,
71 // CHECK-NEXT:      "col": 10,
72 // CHECK-NEXT:      "tokLen": 1
73 // CHECK-NEXT:     }
74 // CHECK-NEXT:    },
75 // CHECK-NEXT:    "type": {
76 // CHECK-NEXT:     "qualType": "unsigned int"
77 // CHECK-NEXT:    },
78 // CHECK-NEXT:    "valueCategory": "rvalue",
79 // CHECK-NEXT:    "castKind": "LValueToRValue",
80 // CHECK-NEXT:    "inner": [
81 // CHECK-NEXT:     {
82 // CHECK-NEXT:      "id": "0x{{.*}}",
83 // CHECK-NEXT:      "kind": "DeclRefExpr",
84 // CHECK-NEXT:      "range": {
85 // CHECK-NEXT:       "begin": {
86 // CHECK-NEXT:        "offset": 148,
87 // CHECK-NEXT:        "col": 10,
88 // CHECK-NEXT:        "tokLen": 1
89 // CHECK-NEXT:       },
90 // CHECK-NEXT:       "end": {
91 // CHECK-NEXT:        "offset": 148,
92 // CHECK-NEXT:        "col": 10,
93 // CHECK-NEXT:        "tokLen": 1
94 // CHECK-NEXT:       }
95 // CHECK-NEXT:      },
96 // CHECK-NEXT:      "type": {
97 // CHECK-NEXT:       "qualType": "unsigned int"
98 // CHECK-NEXT:      },
99 // CHECK-NEXT:      "valueCategory": "lvalue",
100 // CHECK-NEXT:      "referencedDecl": {
101 // CHECK-NEXT:       "id": "0x{{.*}}",
102 // CHECK-NEXT:       "kind": "ParmVarDecl",
103 // CHECK-NEXT:       "name": "x",
104 // CHECK-NEXT:       "type": {
105 // CHECK-NEXT:        "qualType": "unsigned int"
106 // CHECK-NEXT:       }
107 // CHECK-NEXT:      }
108 // CHECK-NEXT:     }
109 // CHECK-NEXT:    ]
110 // CHECK-NEXT:   }
111 // CHECK-NEXT:  ]
112 // CHECK-NEXT: }
113 
114 
115 // CHECK:  "kind": "ImplicitCastExpr",
116 // CHECK-NEXT:  "range": {
117 // CHECK-NEXT:   "begin": {
118 // CHECK-NEXT:    "offset": 208,
119 // CHECK-NEXT:    "col": 10,
120 // CHECK-NEXT:    "tokLen": 1
121 // CHECK-NEXT:   },
122 // CHECK-NEXT:   "end": {
123 // CHECK-NEXT:    "offset": 208,
124 // CHECK-NEXT:    "col": 10,
125 // CHECK-NEXT:    "tokLen": 1
126 // CHECK-NEXT:   }
127 // CHECK-NEXT:  },
128 // CHECK-NEXT:  "type": {
129 // CHECK-NEXT:   "qualType": "signed char"
130 // CHECK-NEXT:  },
131 // CHECK-NEXT:  "valueCategory": "rvalue",
132 // CHECK-NEXT:  "castKind": "IntegralCast",
133 // CHECK-NEXT:  "inner": [
134 // CHECK-NEXT:   {
135 // CHECK-NEXT:    "id": "0x{{.*}}",
136 // CHECK-NEXT:    "kind": "ImplicitCastExpr",
137 // CHECK-NEXT:    "range": {
138 // CHECK-NEXT:     "begin": {
139 // CHECK-NEXT:      "offset": 208,
140 // CHECK-NEXT:      "col": 10,
141 // CHECK-NEXT:      "tokLen": 1
142 // CHECK-NEXT:     },
143 // CHECK-NEXT:     "end": {
144 // CHECK-NEXT:      "offset": 208,
145 // CHECK-NEXT:      "col": 10,
146 // CHECK-NEXT:      "tokLen": 1
147 // CHECK-NEXT:     }
148 // CHECK-NEXT:    },
149 // CHECK-NEXT:    "type": {
150 // CHECK-NEXT:     "qualType": "unsigned int"
151 // CHECK-NEXT:    },
152 // CHECK-NEXT:    "valueCategory": "rvalue",
153 // CHECK-NEXT:    "castKind": "LValueToRValue",
154 // CHECK-NEXT:    "inner": [
155 // CHECK-NEXT:     {
156 // CHECK-NEXT:      "id": "0x{{.*}}",
157 // CHECK-NEXT:      "kind": "DeclRefExpr",
158 // CHECK-NEXT:      "range": {
159 // CHECK-NEXT:       "begin": {
160 // CHECK-NEXT:        "offset": 208,
161 // CHECK-NEXT:        "col": 10,
162 // CHECK-NEXT:        "tokLen": 1
163 // CHECK-NEXT:       },
164 // CHECK-NEXT:       "end": {
165 // CHECK-NEXT:        "offset": 208,
166 // CHECK-NEXT:        "col": 10,
167 // CHECK-NEXT:        "tokLen": 1
168 // CHECK-NEXT:       }
169 // CHECK-NEXT:      },
170 // CHECK-NEXT:      "type": {
171 // CHECK-NEXT:       "qualType": "unsigned int"
172 // CHECK-NEXT:      },
173 // CHECK-NEXT:      "valueCategory": "lvalue",
174 // CHECK-NEXT:      "referencedDecl": {
175 // CHECK-NEXT:       "id": "0x{{.*}}",
176 // CHECK-NEXT:       "kind": "ParmVarDecl",
177 // CHECK-NEXT:       "name": "x",
178 // CHECK-NEXT:       "type": {
179 // CHECK-NEXT:        "qualType": "unsigned int"
180 // CHECK-NEXT:       }
181 // CHECK-NEXT:      }
182 // CHECK-NEXT:     }
183 // CHECK-NEXT:    ]
184 // CHECK-NEXT:   }
185 // CHECK-NEXT:  ]
186 // CHECK-NEXT: }
187 
188 
189 // CHECK:  "kind": "ImplicitCastExpr",
190 // CHECK-NEXT:  "range": {
191 // CHECK-NEXT:   "begin": {
192 // CHECK-NEXT:    "offset": 268,
193 // CHECK-NEXT:    "col": 10,
194 // CHECK-NEXT:    "tokLen": 1
195 // CHECK-NEXT:   },
196 // CHECK-NEXT:   "end": {
197 // CHECK-NEXT:    "offset": 268,
198 // CHECK-NEXT:    "col": 10,
199 // CHECK-NEXT:    "tokLen": 1
200 // CHECK-NEXT:   }
201 // CHECK-NEXT:  },
202 // CHECK-NEXT:  "type": {
203 // CHECK-NEXT:   "qualType": "unsigned char"
204 // CHECK-NEXT:  },
205 // CHECK-NEXT:  "valueCategory": "rvalue",
206 // CHECK-NEXT:  "castKind": "IntegralCast",
207 // CHECK-NEXT:  "inner": [
208 // CHECK-NEXT:   {
209 // CHECK-NEXT:    "id": "0x{{.*}}",
210 // CHECK-NEXT:    "kind": "ImplicitCastExpr",
211 // CHECK-NEXT:    "range": {
212 // CHECK-NEXT:     "begin": {
213 // CHECK-NEXT:      "offset": 268,
214 // CHECK-NEXT:      "col": 10,
215 // CHECK-NEXT:      "tokLen": 1
216 // CHECK-NEXT:     },
217 // CHECK-NEXT:     "end": {
218 // CHECK-NEXT:      "offset": 268,
219 // CHECK-NEXT:      "col": 10,
220 // CHECK-NEXT:      "tokLen": 1
221 // CHECK-NEXT:     }
222 // CHECK-NEXT:    },
223 // CHECK-NEXT:    "type": {
224 // CHECK-NEXT:     "qualType": "int"
225 // CHECK-NEXT:    },
226 // CHECK-NEXT:    "valueCategory": "rvalue",
227 // CHECK-NEXT:    "castKind": "LValueToRValue",
228 // CHECK-NEXT:    "inner": [
229 // CHECK-NEXT:     {
230 // CHECK-NEXT:      "id": "0x{{.*}}",
231 // CHECK-NEXT:      "kind": "DeclRefExpr",
232 // CHECK-NEXT:      "range": {
233 // CHECK-NEXT:       "begin": {
234 // CHECK-NEXT:        "offset": 268,
235 // CHECK-NEXT:        "col": 10,
236 // CHECK-NEXT:        "tokLen": 1
237 // CHECK-NEXT:       },
238 // CHECK-NEXT:       "end": {
239 // CHECK-NEXT:        "offset": 268,
240 // CHECK-NEXT:        "col": 10,
241 // CHECK-NEXT:        "tokLen": 1
242 // CHECK-NEXT:       }
243 // CHECK-NEXT:      },
244 // CHECK-NEXT:      "type": {
245 // CHECK-NEXT:       "qualType": "int"
246 // CHECK-NEXT:      },
247 // CHECK-NEXT:      "valueCategory": "lvalue",
248 // CHECK-NEXT:      "referencedDecl": {
249 // CHECK-NEXT:       "id": "0x{{.*}}",
250 // CHECK-NEXT:       "kind": "ParmVarDecl",
251 // CHECK-NEXT:       "name": "x",
252 // CHECK-NEXT:       "type": {
253 // CHECK-NEXT:        "qualType": "int"
254 // CHECK-NEXT:       }
255 // CHECK-NEXT:      }
256 // CHECK-NEXT:     }
257 // CHECK-NEXT:    ]
258 // CHECK-NEXT:   }
259 // CHECK-NEXT:  ]
260 // CHECK-NEXT: }
261 
262 
263 // CHECK:  "kind": "ImplicitCastExpr",
264 // CHECK-NEXT:  "range": {
265 // CHECK-NEXT:   "begin": {
266 // CHECK-NEXT:    "offset": 326,
267 // CHECK-NEXT:    "col": 10,
268 // CHECK-NEXT:    "tokLen": 1
269 // CHECK-NEXT:   },
270 // CHECK-NEXT:   "end": {
271 // CHECK-NEXT:    "offset": 326,
272 // CHECK-NEXT:    "col": 10,
273 // CHECK-NEXT:    "tokLen": 1
274 // CHECK-NEXT:   }
275 // CHECK-NEXT:  },
276 // CHECK-NEXT:  "type": {
277 // CHECK-NEXT:   "qualType": "signed char"
278 // CHECK-NEXT:  },
279 // CHECK-NEXT:  "valueCategory": "rvalue",
280 // CHECK-NEXT:  "castKind": "IntegralCast",
281 // CHECK-NEXT:  "inner": [
282 // CHECK-NEXT:   {
283 // CHECK-NEXT:    "id": "0x{{.*}}",
284 // CHECK-NEXT:    "kind": "ImplicitCastExpr",
285 // CHECK-NEXT:    "range": {
286 // CHECK-NEXT:     "begin": {
287 // CHECK-NEXT:      "offset": 326,
288 // CHECK-NEXT:      "col": 10,
289 // CHECK-NEXT:      "tokLen": 1
290 // CHECK-NEXT:     },
291 // CHECK-NEXT:     "end": {
292 // CHECK-NEXT:      "offset": 326,
293 // CHECK-NEXT:      "col": 10,
294 // CHECK-NEXT:      "tokLen": 1
295 // CHECK-NEXT:     }
296 // CHECK-NEXT:    },
297 // CHECK-NEXT:    "type": {
298 // CHECK-NEXT:     "qualType": "int"
299 // CHECK-NEXT:    },
300 // CHECK-NEXT:    "valueCategory": "rvalue",
301 // CHECK-NEXT:    "castKind": "LValueToRValue",
302 // CHECK-NEXT:    "inner": [
303 // CHECK-NEXT:     {
304 // CHECK-NEXT:      "id": "0x{{.*}}",
305 // CHECK-NEXT:      "kind": "DeclRefExpr",
306 // CHECK-NEXT:      "range": {
307 // CHECK-NEXT:       "begin": {
308 // CHECK-NEXT:        "offset": 326,
309 // CHECK-NEXT:        "col": 10,
310 // CHECK-NEXT:        "tokLen": 1
311 // CHECK-NEXT:       },
312 // CHECK-NEXT:       "end": {
313 // CHECK-NEXT:        "offset": 326,
314 // CHECK-NEXT:        "col": 10,
315 // CHECK-NEXT:        "tokLen": 1
316 // CHECK-NEXT:       }
317 // CHECK-NEXT:      },
318 // CHECK-NEXT:      "type": {
319 // CHECK-NEXT:       "qualType": "int"
320 // CHECK-NEXT:      },
321 // CHECK-NEXT:      "valueCategory": "lvalue",
322 // CHECK-NEXT:      "referencedDecl": {
323 // CHECK-NEXT:       "id": "0x{{.*}}",
324 // CHECK-NEXT:       "kind": "ParmVarDecl",
325 // CHECK-NEXT:       "name": "x",
326 // CHECK-NEXT:       "type": {
327 // CHECK-NEXT:        "qualType": "int"
328 // CHECK-NEXT:       }
329 // CHECK-NEXT:      }
330 // CHECK-NEXT:     }
331 // CHECK-NEXT:    ]
332 // CHECK-NEXT:   }
333 // CHECK-NEXT:  ]
334 // CHECK-NEXT: }
335 
336 
337 // CHECK:  "kind": "CStyleCastExpr",
338 // CHECK-NEXT:  "range": {
339 // CHECK-NEXT:   "begin": {
340 // CHECK-NEXT:    "offset": 468,
341 // CHECK-NEXT:    "col": 10,
342 // CHECK-NEXT:    "tokLen": 1
343 // CHECK-NEXT:   },
344 // CHECK-NEXT:   "end": {
345 // CHECK-NEXT:    "offset": 483,
346 // CHECK-NEXT:    "col": 25,
347 // CHECK-NEXT:    "tokLen": 1
348 // CHECK-NEXT:   }
349 // CHECK-NEXT:  },
350 // CHECK-NEXT:  "type": {
351 // CHECK-NEXT:   "qualType": "unsigned char"
352 // CHECK-NEXT:  },
353 // CHECK-NEXT:  "valueCategory": "rvalue",
354 // CHECK-NEXT:  "castKind": "IntegralCast",
355 // CHECK-NEXT:  "inner": [
356 // CHECK-NEXT:   {
357 // CHECK-NEXT:    "id": "0x{{.*}}",
358 // CHECK-NEXT:    "kind": "ImplicitCastExpr",
359 // CHECK-NEXT:    "range": {
360 // CHECK-NEXT:     "begin": {
361 // CHECK-NEXT:      "offset": 483,
362 // CHECK-NEXT:      "col": 25,
363 // CHECK-NEXT:      "tokLen": 1
364 // CHECK-NEXT:     },
365 // CHECK-NEXT:     "end": {
366 // CHECK-NEXT:      "offset": 483,
367 // CHECK-NEXT:      "col": 25,
368 // CHECK-NEXT:      "tokLen": 1
369 // CHECK-NEXT:     }
370 // CHECK-NEXT:    },
371 // CHECK-NEXT:    "type": {
372 // CHECK-NEXT:     "qualType": "unsigned int"
373 // CHECK-NEXT:    },
374 // CHECK-NEXT:    "valueCategory": "rvalue",
375 // CHECK-NEXT:    "castKind": "LValueToRValue",
376 // CHECK-NEXT:    "isPartOfExplicitCast": true,
377 // CHECK-NEXT:    "inner": [
378 // CHECK-NEXT:     {
379 // CHECK-NEXT:      "id": "0x{{.*}}",
380 // CHECK-NEXT:      "kind": "DeclRefExpr",
381 // CHECK-NEXT:      "range": {
382 // CHECK-NEXT:       "begin": {
383 // CHECK-NEXT:        "offset": 483,
384 // CHECK-NEXT:        "col": 25,
385 // CHECK-NEXT:        "tokLen": 1
386 // CHECK-NEXT:       },
387 // CHECK-NEXT:       "end": {
388 // CHECK-NEXT:        "offset": 483,
389 // CHECK-NEXT:        "col": 25,
390 // CHECK-NEXT:        "tokLen": 1
391 // CHECK-NEXT:       }
392 // CHECK-NEXT:      },
393 // CHECK-NEXT:      "type": {
394 // CHECK-NEXT:       "qualType": "unsigned int"
395 // CHECK-NEXT:      },
396 // CHECK-NEXT:      "valueCategory": "lvalue",
397 // CHECK-NEXT:      "referencedDecl": {
398 // CHECK-NEXT:       "id": "0x{{.*}}",
399 // CHECK-NEXT:       "kind": "ParmVarDecl",
400 // CHECK-NEXT:       "name": "x",
401 // CHECK-NEXT:       "type": {
402 // CHECK-NEXT:        "qualType": "unsigned int"
403 // CHECK-NEXT:       }
404 // CHECK-NEXT:      }
405 // CHECK-NEXT:     }
406 // CHECK-NEXT:    ]
407 // CHECK-NEXT:   }
408 // CHECK-NEXT:  ]
409 // CHECK-NEXT: }
410 
411 
412 // CHECK:  "kind": "CStyleCastExpr",
413 // CHECK-NEXT:  "range": {
414 // CHECK-NEXT:   "begin": {
415 // CHECK-NEXT:    "offset": 541,
416 // CHECK-NEXT:    "col": 10,
417 // CHECK-NEXT:    "tokLen": 1
418 // CHECK-NEXT:   },
419 // CHECK-NEXT:   "end": {
420 // CHECK-NEXT:    "offset": 554,
421 // CHECK-NEXT:    "col": 23,
422 // CHECK-NEXT:    "tokLen": 1
423 // CHECK-NEXT:   }
424 // CHECK-NEXT:  },
425 // CHECK-NEXT:  "type": {
426 // CHECK-NEXT:   "qualType": "signed char"
427 // CHECK-NEXT:  },
428 // CHECK-NEXT:  "valueCategory": "rvalue",
429 // CHECK-NEXT:  "castKind": "IntegralCast",
430 // CHECK-NEXT:  "inner": [
431 // CHECK-NEXT:   {
432 // CHECK-NEXT:    "id": "0x{{.*}}",
433 // CHECK-NEXT:    "kind": "ImplicitCastExpr",
434 // CHECK-NEXT:    "range": {
435 // CHECK-NEXT:     "begin": {
436 // CHECK-NEXT:      "offset": 554,
437 // CHECK-NEXT:      "col": 23,
438 // CHECK-NEXT:      "tokLen": 1
439 // CHECK-NEXT:     },
440 // CHECK-NEXT:     "end": {
441 // CHECK-NEXT:      "offset": 554,
442 // CHECK-NEXT:      "col": 23,
443 // CHECK-NEXT:      "tokLen": 1
444 // CHECK-NEXT:     }
445 // CHECK-NEXT:    },
446 // CHECK-NEXT:    "type": {
447 // CHECK-NEXT:     "qualType": "unsigned int"
448 // CHECK-NEXT:    },
449 // CHECK-NEXT:    "valueCategory": "rvalue",
450 // CHECK-NEXT:    "castKind": "LValueToRValue",
451 // CHECK-NEXT:    "isPartOfExplicitCast": true,
452 // CHECK-NEXT:    "inner": [
453 // CHECK-NEXT:     {
454 // CHECK-NEXT:      "id": "0x{{.*}}",
455 // CHECK-NEXT:      "kind": "DeclRefExpr",
456 // CHECK-NEXT:      "range": {
457 // CHECK-NEXT:       "begin": {
458 // CHECK-NEXT:        "offset": 554,
459 // CHECK-NEXT:        "col": 23,
460 // CHECK-NEXT:        "tokLen": 1
461 // CHECK-NEXT:       },
462 // CHECK-NEXT:       "end": {
463 // CHECK-NEXT:        "offset": 554,
464 // CHECK-NEXT:        "col": 23,
465 // CHECK-NEXT:        "tokLen": 1
466 // CHECK-NEXT:       }
467 // CHECK-NEXT:      },
468 // CHECK-NEXT:      "type": {
469 // CHECK-NEXT:       "qualType": "unsigned int"
470 // CHECK-NEXT:      },
471 // CHECK-NEXT:      "valueCategory": "lvalue",
472 // CHECK-NEXT:      "referencedDecl": {
473 // CHECK-NEXT:       "id": "0x{{.*}}",
474 // CHECK-NEXT:       "kind": "ParmVarDecl",
475 // CHECK-NEXT:       "name": "x",
476 // CHECK-NEXT:       "type": {
477 // CHECK-NEXT:        "qualType": "unsigned int"
478 // CHECK-NEXT:       }
479 // CHECK-NEXT:      }
480 // CHECK-NEXT:     }
481 // CHECK-NEXT:    ]
482 // CHECK-NEXT:   }
483 // CHECK-NEXT:  ]
484 // CHECK-NEXT: }
485 
486 
487 // CHECK:  "kind": "CStyleCastExpr",
488 // CHECK-NEXT:  "range": {
489 // CHECK-NEXT:   "begin": {
490 // CHECK-NEXT:    "offset": 612,
491 // CHECK-NEXT:    "col": 10,
492 // CHECK-NEXT:    "tokLen": 1
493 // CHECK-NEXT:   },
494 // CHECK-NEXT:   "end": {
495 // CHECK-NEXT:    "offset": 627,
496 // CHECK-NEXT:    "col": 25,
497 // CHECK-NEXT:    "tokLen": 1
498 // CHECK-NEXT:   }
499 // CHECK-NEXT:  },
500 // CHECK-NEXT:  "type": {
501 // CHECK-NEXT:   "qualType": "unsigned char"
502 // CHECK-NEXT:  },
503 // CHECK-NEXT:  "valueCategory": "rvalue",
504 // CHECK-NEXT:  "castKind": "IntegralCast",
505 // CHECK-NEXT:  "inner": [
506 // CHECK-NEXT:   {
507 // CHECK-NEXT:    "id": "0x{{.*}}",
508 // CHECK-NEXT:    "kind": "ImplicitCastExpr",
509 // CHECK-NEXT:    "range": {
510 // CHECK-NEXT:     "begin": {
511 // CHECK-NEXT:      "offset": 627,
512 // CHECK-NEXT:      "col": 25,
513 // CHECK-NEXT:      "tokLen": 1
514 // CHECK-NEXT:     },
515 // CHECK-NEXT:     "end": {
516 // CHECK-NEXT:      "offset": 627,
517 // CHECK-NEXT:      "col": 25,
518 // CHECK-NEXT:      "tokLen": 1
519 // CHECK-NEXT:     }
520 // CHECK-NEXT:    },
521 // CHECK-NEXT:    "type": {
522 // CHECK-NEXT:     "qualType": "int"
523 // CHECK-NEXT:    },
524 // CHECK-NEXT:    "valueCategory": "rvalue",
525 // CHECK-NEXT:    "castKind": "LValueToRValue",
526 // CHECK-NEXT:    "isPartOfExplicitCast": true,
527 // CHECK-NEXT:    "inner": [
528 // CHECK-NEXT:     {
529 // CHECK-NEXT:      "id": "0x{{.*}}",
530 // CHECK-NEXT:      "kind": "DeclRefExpr",
531 // CHECK-NEXT:      "range": {
532 // CHECK-NEXT:       "begin": {
533 // CHECK-NEXT:        "offset": 627,
534 // CHECK-NEXT:        "col": 25,
535 // CHECK-NEXT:        "tokLen": 1
536 // CHECK-NEXT:       },
537 // CHECK-NEXT:       "end": {
538 // CHECK-NEXT:        "offset": 627,
539 // CHECK-NEXT:        "col": 25,
540 // CHECK-NEXT:        "tokLen": 1
541 // CHECK-NEXT:       }
542 // CHECK-NEXT:      },
543 // CHECK-NEXT:      "type": {
544 // CHECK-NEXT:       "qualType": "int"
545 // CHECK-NEXT:      },
546 // CHECK-NEXT:      "valueCategory": "lvalue",
547 // CHECK-NEXT:      "referencedDecl": {
548 // CHECK-NEXT:       "id": "0x{{.*}}",
549 // CHECK-NEXT:       "kind": "ParmVarDecl",
550 // CHECK-NEXT:       "name": "x",
551 // CHECK-NEXT:       "type": {
552 // CHECK-NEXT:        "qualType": "int"
553 // CHECK-NEXT:       }
554 // CHECK-NEXT:      }
555 // CHECK-NEXT:     }
556 // CHECK-NEXT:    ]
557 // CHECK-NEXT:   }
558 // CHECK-NEXT:  ]
559 // CHECK-NEXT: }
560 
561 
562 // CHECK:  "kind": "CStyleCastExpr",
563 // CHECK-NEXT:  "range": {
564 // CHECK-NEXT:   "begin": {
565 // CHECK-NEXT:    "offset": 683,
566 // CHECK-NEXT:    "col": 10,
567 // CHECK-NEXT:    "tokLen": 1
568 // CHECK-NEXT:   },
569 // CHECK-NEXT:   "end": {
570 // CHECK-NEXT:    "offset": 696,
571 // CHECK-NEXT:    "col": 23,
572 // CHECK-NEXT:    "tokLen": 1
573 // CHECK-NEXT:   }
574 // CHECK-NEXT:  },
575 // CHECK-NEXT:  "type": {
576 // CHECK-NEXT:   "qualType": "signed char"
577 // CHECK-NEXT:  },
578 // CHECK-NEXT:  "valueCategory": "rvalue",
579 // CHECK-NEXT:  "castKind": "IntegralCast",
580 // CHECK-NEXT:  "inner": [
581 // CHECK-NEXT:   {
582 // CHECK-NEXT:    "id": "0x{{.*}}",
583 // CHECK-NEXT:    "kind": "ImplicitCastExpr",
584 // CHECK-NEXT:    "range": {
585 // CHECK-NEXT:     "begin": {
586 // CHECK-NEXT:      "offset": 696,
587 // CHECK-NEXT:      "col": 23,
588 // CHECK-NEXT:      "tokLen": 1
589 // CHECK-NEXT:     },
590 // CHECK-NEXT:     "end": {
591 // CHECK-NEXT:      "offset": 696,
592 // CHECK-NEXT:      "col": 23,
593 // CHECK-NEXT:      "tokLen": 1
594 // CHECK-NEXT:     }
595 // CHECK-NEXT:    },
596 // CHECK-NEXT:    "type": {
597 // CHECK-NEXT:     "qualType": "int"
598 // CHECK-NEXT:    },
599 // CHECK-NEXT:    "valueCategory": "rvalue",
600 // CHECK-NEXT:    "castKind": "LValueToRValue",
601 // CHECK-NEXT:    "isPartOfExplicitCast": true,
602 // CHECK-NEXT:    "inner": [
603 // CHECK-NEXT:     {
604 // CHECK-NEXT:      "id": "0x{{.*}}",
605 // CHECK-NEXT:      "kind": "DeclRefExpr",
606 // CHECK-NEXT:      "range": {
607 // CHECK-NEXT:       "begin": {
608 // CHECK-NEXT:        "offset": 696,
609 // CHECK-NEXT:        "col": 23,
610 // CHECK-NEXT:        "tokLen": 1
611 // CHECK-NEXT:       },
612 // CHECK-NEXT:       "end": {
613 // CHECK-NEXT:        "offset": 696,
614 // CHECK-NEXT:        "col": 23,
615 // CHECK-NEXT:        "tokLen": 1
616 // CHECK-NEXT:       }
617 // CHECK-NEXT:      },
618 // CHECK-NEXT:      "type": {
619 // CHECK-NEXT:       "qualType": "int"
620 // CHECK-NEXT:      },
621 // CHECK-NEXT:      "valueCategory": "lvalue",
622 // CHECK-NEXT:      "referencedDecl": {
623 // CHECK-NEXT:       "id": "0x{{.*}}",
624 // CHECK-NEXT:       "kind": "ParmVarDecl",
625 // CHECK-NEXT:       "name": "x",
626 // CHECK-NEXT:       "type": {
627 // CHECK-NEXT:        "qualType": "int"
628 // CHECK-NEXT:       }
629 // CHECK-NEXT:      }
630 // CHECK-NEXT:     }
631 // CHECK-NEXT:    ]
632 // CHECK-NEXT:   }
633 // CHECK-NEXT:  ]
634 // CHECK-NEXT: }
635