aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2010-08-14 20:46:10 +0000
committerJordy Rose <jediknil@belkadan.com>2010-08-14 20:46:10 +0000
commit8556cc44af71f6147e1a821489b56f35acadea3f (patch)
tree7c030fedec284e2d5f16f2d5f6be7f1d3e41d583
parentc2b7dfaad674587cfd220ff447b3710d252130c3 (diff)
Add a test for alloca region extents.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111079 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Analysis/outofbound.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Analysis/outofbound.c b/test/Analysis/outofbound.c
index 9b487300c8..529f0e77b2 100644
--- a/test/Analysis/outofbound.c
+++ b/test/Analysis/outofbound.c
@@ -71,3 +71,11 @@ void sizeof_vla(int a) {
y[5] = 5; // expected-warning{{out-of-bound}}
}
}
+
+void alloca_region(int a) {
+ if (a == 5) {
+ char *x = __builtin_alloca(a);
+ x[4] = 4; // no-warning
+ x[5] = 5; // expected-warning{{out-of-bound}}
+ }
+}