From: Ted Kremenek Date: Sun, 3 May 2009 19:24:34 +0000 (+0000) Subject: Add RegionStore test that illustrates a bogus array-out-of-bounds error. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=96682554198b20764c1b8cbb3f77e4c3dd76d42b;p=clang Add RegionStore test that illustrates a bogus array-out-of-bounds error. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70795 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Analysis/xfail_regionstore_bogus_array_bounds_failure.c b/test/Analysis/xfail_regionstore_bogus_array_bounds_failure.c new file mode 100644 index 0000000000..0eb36519ca --- /dev/null +++ b/test/Analysis/xfail_regionstore_bogus_array_bounds_failure.c @@ -0,0 +1,11 @@ +// RUN: clang-cc -checker-cfref -analyze -analyzer-store=region -verify %s +// XFAIL + +// What we are seeing: Load or store into an out-of-bound memory position +// This is bogus. + +void f() { + long x = 0; + char *y = (char*) &x; + char c = y[0] + y[1] + y[2]; // no-warning +}