[cfe-commits] r59931 - /cfe/trunk/test/Analysis/outofbound.c

Zhongxing Xu xuzhongxing at gmail.com
Sun Nov 23 18:19:49 PST 2008


Author: zhongxingxu
Date: Sun Nov 23 20:19:49 2008
New Revision: 59931

URL: http://llvm.org/viewvc/llvm-project?rev=59931&view=rev
Log:
Add test case for out-of-bound memory access checking.

Added:
    cfe/trunk/test/Analysis/outofbound.c

Added: cfe/trunk/test/Analysis/outofbound.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/outofbound.c?rev=59931&view=auto

==============================================================================
--- cfe/trunk/test/Analysis/outofbound.c (added)
+++ cfe/trunk/test/Analysis/outofbound.c Sun Nov 23 20:19:49 2008
@@ -0,0 +1,6 @@
+// RUN: clang -checker-simple -analyzer-store-region -verify %s
+
+char f1() {
+  char* s = "abcd";
+  return s[4]; // expected-warning{{Load or store into an out-of-bound memory position.}}
+}





More information about the cfe-commits mailing list