blob: 4f648b986b25ab92ab1f8b8507d65a614d7a26c3 [file] [log] [blame]
Jordan Rose15a185f2013-03-19 22:10:44 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-null-return-paths=true -analyzer-output=text -verify %s
2// expected-no-diagnostics
3
4int *returnNull() { return 0; }
5int coin();
6
7// Use a float parameter to ensure that the value is unknown. This will create
8// a cycle in the generated ExplodedGraph.
9void testCycle(float i) {
10 int *x = returnNull();
11 int y;
12 while (i > 0) {
13 x = returnNull();
14 y = 2;
15 i -= 1;
16 }
17 *x = 1; // no-warning
18 y += 1;
19}