Artem Dergachev | b0914e7 | 2019-10-19 00:08:17 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -std=c++14 -triple i386-apple-darwin10 -analyze -analyzer-checker=core.builtin,debug.ExprInspection -verify %s |
Rafael Stahl | 0137aa8 | 2018-05-29 14:14:22 +0000 | [diff] [blame] | 2 | |
| 3 | void clang_analyzer_eval(int); |
| 4 | |
| 5 | struct S { |
| 6 | int a = 3; |
| 7 | }; |
| 8 | S const sarr[2] = {}; |
| 9 | void definit() { |
| 10 | int i = 1; |
| 11 | // FIXME: Should recognize that it is 3. |
| 12 | clang_analyzer_eval(sarr[i].a); // expected-warning{{UNKNOWN}} |
| 13 | } |
| 14 | |
| 15 | int const arr[2][2] = {}; |
| 16 | void arr2init() { |
| 17 | int i = 1; |
| 18 | // FIXME: Should recognize that it is 0. |
| 19 | clang_analyzer_eval(arr[i][0]); // expected-warning{{UNKNOWN}} |
| 20 | } |