summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2008-11-24 02:19:49 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2008-11-24 02:19:49 +0000
commitbf900755d01fa5e497fd918235c143a7801f436f (patch)
tree34eccf1b5f15fd0a13db578edc912a42ffb5f2db
parenta61731dd0d7d01a1392642cfa29b8baf08ccdd35 (diff)
downloadbcm5719-llvm-bf900755d01fa5e497fd918235c143a7801f436f.tar.gz
bcm5719-llvm-bf900755d01fa5e497fd918235c143a7801f436f.zip
Add test case for out-of-bound memory access checking.
llvm-svn: 59931
-rw-r--r--clang/test/Analysis/outofbound.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Analysis/outofbound.c b/clang/test/Analysis/outofbound.c
new file mode 100644
index 00000000000..17608ff1687
--- /dev/null
+++ b/clang/test/Analysis/outofbound.c
@@ -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.}}
+}
OpenPOWER on IntegriCloud