Split failing test case from misc-ps.m to misc-ps-ranges.m (which tests

functionality specific to RangeConstraintManager).

llvm-svn: 68759
This commit is contained in:
Ted Kremenek 2009-04-10 04:02:38 +00:00
parent a7f71a91c5
commit b3b2395520
2 changed files with 23 additions and 22 deletions

View File

@ -0,0 +1,23 @@
// RUN: clang-cc -analyze -checker-cfref --analyzer-store=basic -analyzer-constraints=range --verify -fblocks %s &&
// RUN: clang-cc -analyze -checker-cfref --analyzer-store=region -analyzer-constraints=range --verify -fblocks %s
// <rdar://problem/6776949>
// main's 'argc' argument is always > 0
int main(int argc, char* argv[]) {
int *p = 0;
if (argc == 0)
*p = 1;
if (argc == 1)
return 1;
int x = 1;
int i;
for(i=1;i<argc;i++){
p = &x;
}
return *p; // no-warning
}

View File

@ -245,25 +245,3 @@ void rdar_6777003(int x) {
*p = 1; // expected-warning{{Dereference of null pointer}}
}
// <rdar://problem/6776949>
// main's 'argc' argument is always > 0
int main(int argc, char* argv[]) {
int *p = 0;
if (argc == 0)
*p = 1;
if (argc == 1)
return 1;
int x = 1;
int i;
for(i=1;i<argc;i++){
p = &x;
}
return *p; // no-warning
}