summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/temporaries.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-02-04 17:32:58 +0000
committerAnders Carlsson <andersca@mac.com>2010-02-04 17:32:58 +0000
commit0dc736627614b476ec696fa216dd2a524d0bafad (patch)
treea23f270cd525a7a3b5e91367b09b28b2ab90a38e /test/CodeGenCXX/temporaries.cpp
parent8ffc80fe5413bcb9f350ae4d1c2d7617af970c8e (diff)
When binding an lvalue to a reference, we always need to pop temporaries.
With this fix, and the other fixes committed today a make check-all with a clang-built LLVM now gives: Expected Passes : 6933 Expected Failures : 46 Unsupported Tests : 40 Unexpected Failures: 27 which means that we pass 99.96% of all tests :) The resulting 27 tests are all LLVMC tests and seem to be because of differences in the clang and gcc drivers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95313 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/temporaries.cpp')
-rw-r--r--test/CodeGenCXX/temporaries.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGenCXX/temporaries.cpp b/test/CodeGenCXX/temporaries.cpp
index c33ca4ebff..3b624afd0a 100644
--- a/test/CodeGenCXX/temporaries.cpp
+++ b/test/CodeGenCXX/temporaries.cpp
@@ -267,3 +267,24 @@ namespace PR6199 {
template A f2<int>(int);
}
+
+namespace T12 {
+
+struct A {
+ A();
+ ~A();
+ int f();
+};
+
+int& f(int);
+
+// CHECK: define void @_ZN3T121gEv
+void g() {
+ // CHECK: call void @_ZN3T121AC1Ev
+ // CHECK-NEXT: call i32 @_ZN3T121A1fEv(
+ // CHECK-NEXT: call i32* @_ZN3T121fEi(
+ // CHECK-NEXT: call void @_ZN3T121AD1Ev(
+ int& i = f(A().f());
+}
+
+}