[analyzer] Add a test case for diagnostic suppression on a graph with cycles.

(see previous commit)

llvm-svn: 177449
This commit is contained in:
Jordan Rose 2013-03-19 22:10:44 +00:00
parent 431e4e4d0e
commit 15a185f1e0
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-null-return-paths=true -analyzer-output=text -verify %s
// expected-no-diagnostics
int *returnNull() { return 0; }
int coin();
// Use a float parameter to ensure that the value is unknown. This will create
// a cycle in the generated ExplodedGraph.
void testCycle(float i) {
int *x = returnNull();
int y;
while (i > 0) {
x = returnNull();
y = 2;
i -= 1;
}
*x = 1; // no-warning
y += 1;
}