summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/vlt_to_reference.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2014-12-18 06:54:53 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2014-12-18 06:54:53 +0000
commit9b8aa02e2afac5b5463a6d265454a84df5f1e4b6 (patch)
treeb29b368a789745389212331124d5d741dc8869af /test/CodeGenCXX/vlt_to_reference.cpp
parent23cf9d557e2396291b461c7c16a889fc97fa25a3 (diff)
Fix for PR21915: assert on multidimensional VLA in function arguments.
Fixed assertion on type checking for arguments and parameters on function call if arguments are pointers to VLA Differential Revision: http://reviews.llvm.org/D6655 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/vlt_to_reference.cpp')
-rw-r--r--test/CodeGenCXX/vlt_to_reference.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGenCXX/vlt_to_reference.cpp b/test/CodeGenCXX/vlt_to_reference.cpp
new file mode 100644
index 0000000000..49d7f1aa97
--- /dev/null
+++ b/test/CodeGenCXX/vlt_to_reference.cpp
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
+
+// CHECK-LABEL: @main
+
+struct dyn_array {
+ int size;
+ int data[];
+};
+
+int foo(dyn_array **&d) {
+ return (*d)->data[1];
+}
+
+int main()
+{
+ dyn_array **d;
+ return foo(d);
+
+ // CHECK: call {{.+}} @{{.+}}foo{{.+}}(
+ // CHECK: ret i{{[0-9]+}}
+}
+