diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-11-11 12:33:27 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2009-11-11 12:33:27 +0000 |
commit | 58e689fead1490611bcd114fb707bfc08a12049e (patch) | |
tree | 49d4707ae326eb1eef3ec68f664e3f1a3b194217 /test | |
parent | b991f48ccff0567d581cf95e4eda1bffd5bbada3 (diff) |
Reimplement out-of-bound array access checker with the new checker interface.
Now only one test case is XFAIL'ed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86834 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/Analysis/no-outofbounds.c | 1 | ||||
-rw-r--r-- | test/Analysis/outofbound.c | 3 | ||||
-rw-r--r-- | test/Analysis/rdar-6541136-region.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/test/Analysis/no-outofbounds.c b/test/Analysis/no-outofbounds.c index bb8f65e1e9..67ea6b5ac8 100644 --- a/test/Analysis/no-outofbounds.c +++ b/test/Analysis/no-outofbounds.c @@ -1,5 +1,6 @@ // RUN: clang-cc -checker-cfref -analyze -analyzer-store=basic -verify %s // RUN: clang-cc -checker-cfref -analyze -analyzer-store=region -verify %s +// XFAIL: * //===----------------------------------------------------------------------===// // This file tests cases where we should not flag out-of-bounds warnings. diff --git a/test/Analysis/outofbound.c b/test/Analysis/outofbound.c index e676ea3b38..102ab59874 100644 --- a/test/Analysis/outofbound.c +++ b/test/Analysis/outofbound.c @@ -1,8 +1,7 @@ // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s -// XFAIL: * char f1() { char* s = "abcd"; char c = s[4]; // no-warning - return s[5] + c; // expected-warning{{Load or store into an out-of-bound memory position.}} + return s[5] + c; // expected-warning{{Access out-of-bound array element (buffer overflow)}} } diff --git a/test/Analysis/rdar-6541136-region.c b/test/Analysis/rdar-6541136-region.c index e2779e8d91..a07308f96c 100644 --- a/test/Analysis/rdar-6541136-region.c +++ b/test/Analysis/rdar-6541136-region.c @@ -13,10 +13,10 @@ void foo( void ) struct load_wine *cmd = (void*) &wonky[1]; cmd = cmd; char *p = (void*) &wonky[1]; - *p = 1; // no-warning + //*p = 1; // this is also an out-of-bound access. kernel_tea_cheese_t *q = &wonky[1]; // This test case tests both the RegionStore logic (doesn't crash) and // the out-of-bounds checking. We don't expect the warning for now since // out-of-bound checking is temporarily disabled. - kernel_tea_cheese_t r = *q; // eventually-warning{{out-of-bound memory position}} + kernel_tea_cheese_t r = *q; // expected-warning{{Access out-of-bound array element (buffer overflow)}} } |