summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/casts.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/casts.c')
-rw-r--r--clang/test/Analysis/casts.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Analysis/casts.c b/clang/test/Analysis/casts.c
index 947f63ef48b..96c0226a005 100644
--- a/clang/test/Analysis/casts.c
+++ b/clang/test/Analysis/casts.c
@@ -45,3 +45,13 @@ void f2(const char *str) {
if(!cl)
cl = 'a';
}
+
+// Test cast VariableSizeArray to pointer does not crash.
+void *memcpy(void *, void const *, unsigned long);
+typedef unsigned char Byte;
+void doit(char *data, int len) {
+ if (len) {
+ Byte buf[len];
+ memcpy(buf, data, len);
+ }
+}
OpenPOWER on IntegriCloud