aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/no-outofbounds.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Analysis/no-outofbounds.c')
-rw-r--r--test/Analysis/no-outofbounds.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Analysis/no-outofbounds.c b/test/Analysis/no-outofbounds.c
new file mode 100644
index 000000000000..94052806f0aa
--- /dev/null
+++ b/test/Analysis/no-outofbounds.c
@@ -0,0 +1,12 @@
+// RUN: clang-cc -checker-cfref -analyze -analyzer-store=basic -verify %s &&
+// RUN: clang-cc -checker-cfref -analyze -analyzer-store=region -verify %s
+
+//===----------------------------------------------------------------------===//
+// This file tests cases where we should not flag out-of-bounds warnings.
+//===----------------------------------------------------------------------===//
+
+void f() {
+ long x = 0;
+ char *y = (char*) &x;
+ char c = y[0] + y[1] + y[2]; // no-warning
+}