summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
Diffstat (limited to 'clang')
-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