blob: 5f0951857b13f79907b54185ea96389ade50f47d [file] [log] [blame]
Anna Zaks4e9179a2013-05-28 17:31:43 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core,debug.ExprInspection -verify %s
2// expected-no-diagnostics
3struct X {
4 int *p;
5 int zero;
6 void foo () {
7 reset(p - 1);
8 }
9 void reset(int *in) {
10 while (in != p) // Loop must be entered.
11 zero = 1;
12 }
13};
14
15int test (int *in) {
16 X littleX;
17 littleX.zero = 0;
18 littleX.p = in;
19 littleX.foo();
20 return 5/littleX.zero; // no-warning
21}
22