]> granicus.if.org Git - clang/commitdiff
Add RegionStore test that illustrates a bogus array-out-of-bounds error.
authorTed Kremenek <kremenek@apple.com>
Sun, 3 May 2009 19:24:34 +0000 (19:24 +0000)
committerTed Kremenek <kremenek@apple.com>
Sun, 3 May 2009 19:24:34 +0000 (19:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70795 91177308-0d34-0410-b5e6-96231b3b80d8

test/Analysis/xfail_regionstore_bogus_array_bounds_failure.c [new file with mode: 0644]

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 (file)
index 0000000..0eb3651
--- /dev/null
@@ -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
+}