aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/temp-1.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-09-14 01:30:44 +0000
committerAnders Carlsson <andersca@mac.com>2009-09-14 01:30:44 +0000
commit283e4d59b8fe63e93f20b6ffb3a623a4f60a85ea (patch)
tree0a62837310f7b09b7f6dc58346f79129d8b08fef /test/CodeGenCXX/temp-1.cpp
parentb9ea0b53d323cdca2b8284ff986a878e195cb97f (diff)
If a function call returns a reference, don't bind it to a temporary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81743 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/temp-1.cpp')
-rw-r--r--test/CodeGenCXX/temp-1.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/CodeGenCXX/temp-1.cpp b/test/CodeGenCXX/temp-1.cpp
index 19a6acecf2..9b97f0083c 100644
--- a/test/CodeGenCXX/temp-1.cpp
+++ b/test/CodeGenCXX/temp-1.cpp
@@ -63,9 +63,21 @@ struct E {
};
// RUN: grep "call void @_ZN1EC1Ev" %t | count 3 &&
-// RUN: grep "call void @_ZN1ED1Ev" %t | count 5
+// RUN: grep "call void @_ZN1ED1Ev" %t | count 5 &&
void f5() {
E() + E();
!E();
}
+struct F {
+ F();
+ ~F();
+ F& f();
+};
+
+// RUN: grep "call void @_ZN1FC1Ev" %t | count 1 &&
+// RUN: grep "call void @_ZN1FD1Ev" %t | count 1
+void f6() {
+ F().f();
+}
+