forked from OSchip/llvm-project
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:
parent
a7f71a91c5
commit
b3b2395520
|
@ -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
|
||||
}
|
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue