Bind references to lvalues correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72150 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/references.cpp b/test/CodeGenCXX/references.cpp
index 26d7157..2b2b1ff 100644
--- a/test/CodeGenCXX/references.cpp
+++ b/test/CodeGenCXX/references.cpp
@@ -14,3 +14,30 @@
void t3() {
int b = gr;
}
+
+// Test reference binding.
+
+struct C {};
+
+void f(const int&);
+void f(const _Complex int&);
+void f(const C&);
+
+void test_scalar() {
+ int a = 10;
+
+ f(a);
+}
+
+void test_complex() {
+ _Complex int a = 10i;
+
+ f(a);
+}
+
+void test_aggregate() {
+ C c;
+
+ f(c);
+}
+