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 | 4f7759a33966a0398a945b0afa830a09939f59f4 (patch) | |
| tree | ac15ab9f035fcde3f1ccf2d76bf17633667a9908 /clang/test | |
| parent | 3ef93badbe6fbb62c8df82d7bff138a7d8851695 (diff) | |
| download | bcm5719-llvm-4f7759a33966a0398a945b0afa830a09939f59f4.tar.gz bcm5719-llvm-4f7759a33966a0398a945b0afa830a09939f59f4.zip | |
Reimplement out-of-bound array access checker with the new checker interface.
Now only one test case is XFAIL'ed.
llvm-svn: 86834
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Analysis/no-outofbounds.c | 1 | ||||
| -rw-r--r-- | clang/test/Analysis/outofbound.c | 3 | ||||
| -rw-r--r-- | clang/test/Analysis/rdar-6541136-region.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/clang/test/Analysis/no-outofbounds.c b/clang/test/Analysis/no-outofbounds.c index bb8f65e1e96..67ea6b5ac8e 100644 --- a/clang/test/Analysis/no-outofbounds.c +++ b/clang/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/clang/test/Analysis/outofbound.c b/clang/test/Analysis/outofbound.c index e676ea3b388..102ab59874c 100644 --- a/clang/test/Analysis/outofbound.c +++ b/clang/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/clang/test/Analysis/rdar-6541136-region.c b/clang/test/Analysis/rdar-6541136-region.c index e2779e8d914..a07308f96c4 100644 --- a/clang/test/Analysis/rdar-6541136-region.c +++ b/clang/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)}} } |

