summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/outofbound.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/outofbound.c')
-rw-r--r--clang/test/Analysis/outofbound.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/test/Analysis/outofbound.c b/clang/test/Analysis/outofbound.c
index 8ffb3e1efbf..9b487300c88 100644
--- a/clang/test/Analysis/outofbound.c
+++ b/clang/test/Analysis/outofbound.c
@@ -62,3 +62,12 @@ void vla(int a) {
x[5] = 5; // expected-warning{{out-of-bound}}
}
}
+
+void sizeof_vla(int a) {
+ if (a == 5) {
+ char x[a];
+ int y[sizeof(x)];
+ y[4] = 4; // no-warning
+ y[5] = 5; // expected-warning{{out-of-bound}}
+ }
+}
OpenPOWER on IntegriCloud