Don't bind arguments to temporaries if the argument has a reference type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88662 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/temporaries.cpp b/test/CodeGenCXX/temporaries.cpp
index 4f65e46..e550274 100644
--- a/test/CodeGenCXX/temporaries.cpp
+++ b/test/CodeGenCXX/temporaries.cpp
@@ -188,3 +188,17 @@
// CHECK: call void @_ZN1HD1Ev
f9(h);
}
+
+void f10(const H&);
+
+void f11(H h) {
+ // CHECK: call void @_ZN1HC1Ev
+ // CHECK: call void @_Z3f10RK1H
+ // CHECK: call void @_ZN1HD1Ev
+ f10(H());
+
+ // CHECK: call void @_Z3f10RK1H
+ // CHECK-NOT: call void @_ZN1HD1Ev
+ // CHECK: ret void
+ f10(h);
+}
\ No newline at end of file