aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/Analysis/outofbound.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Analysis/outofbound.c b/test/Analysis/outofbound.c
new file mode 100644
index 0000000000..17608ff168
--- /dev/null
+++ b/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.}}
+}