summaryrefslogtreecommitdiffstats
path: root/test/Analysis/no-outofbounds.c
diff options
context:
space:
mode:
authorJordy Rose <jediknil@belkadan.com>2010-06-25 23:23:04 +0000
committerJordy Rose <jediknil@belkadan.com>2010-06-25 23:23:04 +0000
commit4d912b24b393fe6b7422e5502f3a330cbdc5c6b7 (patch)
treef69ba0da7a6bad3bff807efbb4e2b59067596424 /test/Analysis/no-outofbounds.c
parenta006342c8650738c7e3547a1a0a70334608c5db6 (diff)
When a constant size array is casted to another type, its length should be scaled as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106911 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/no-outofbounds.c')
-rw-r--r--test/Analysis/no-outofbounds.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Analysis/no-outofbounds.c b/test/Analysis/no-outofbounds.c
index 771323b811..49ee80e8c2 100644
--- a/test/Analysis/no-outofbounds.c
+++ b/test/Analysis/no-outofbounds.c
@@ -12,3 +12,9 @@ void f() {
short *z = (short*) &x;
short s = z[0] + z[1]; // no-warning
}
+
+void g() {
+ int a[2];
+ char *b = (char*)a;
+ b[3] = 'c'; // no-warning
+}