Move new test (that requires RegionStore) into its own file.

llvm-svn: 109736
This commit is contained in:
Jordy Rose 2010-07-29 07:11:59 +00:00
parent 2cdfda44a1
commit 23f0f4b7ae
2 changed files with 25 additions and 23 deletions

View File

@ -0,0 +1,25 @@
// RUN: %clang_cc1 -analyze -analyzer-experimental-checks -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=region -analyzer-constraints=basic -verify %s
// RUN: %clang_cc1 -analyze -analyzer-experimental-checks -analyzer-experimental-internal-checks -analyzer-check-objc-mem -analyzer-store=region -analyzer-constraints=range -verify %s
int string_literal_init() {
char a[] = "abc";
char b[2] = "abc"; // expected-warning{{too long}}
char c[5] = "abc";
if (a[1] != 'b')
return 0; // expected-warning{{never executed}}
if (b[1] != 'b')
return 0; // expected-warning{{never executed}}
if (c[1] != 'b')
return 0; // expected-warning{{never executed}}
if (a[3] != 0)
return 0; // expected-warning{{never executed}}
if (c[3] != 0)
return 0; // expected-warning{{never executed}}
if (c[4] != 0)
return 0; // expected-warning{{never executed}}
return 42;
}

View File

@ -178,26 +178,3 @@ void f18() {
if (*q) { // no-warning
}
}
int f19() {
char a[] = "abc";
char b[2] = "abc"; // expected-warning{{too long}}
char c[5] = "abc";
if (a[1] != 'b')
return 5; // expected-warning{{never executed}}
if (b[1] != 'b')
return 5; // expected-warning{{never executed}}
if (c[1] != 'b')
return 5; // expected-warning{{never executed}}
if (a[3] != 0)
return 5; // expected-warning{{never executed}}
if (c[3] != 0)
return 5; // expected-warning{{never executed}}
if (c[4] != 0)
return 5; // expected-warning{{never executed}}
return 0;
}