aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/vlt_to_reference.cpp
diff options
context:
space:
mode:
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 000000000000..49d7f1aa975f
--- /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]+}}
+}
+