summaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/references.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGenCXX/references.cpp')
-rw-r--r--test/CodeGenCXX/references.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/CodeGenCXX/references.cpp b/test/CodeGenCXX/references.cpp
index 32d46b3e104b3..8e0e1cbe84e83 100644
--- a/test/CodeGenCXX/references.cpp
+++ b/test/CodeGenCXX/references.cpp
@@ -107,3 +107,32 @@ void h() {
const C& c = D();
}
+namespace T {
+ struct A {
+ A();
+ ~A();
+ };
+
+ struct B {
+ B();
+ ~B();
+ A f();
+ };
+
+ void f() {
+ // CHECK: call void @_ZN1T1BC1Ev
+ // CHECK: call void @_ZN1T1B1fEv
+ // CHECK: call void @_ZN1T1BD1Ev
+ const A& a = B().f();
+ // CHECK: call void @_ZN1T1fEv
+ f();
+ // CHECK: call void @_ZN1T1AD1Ev
+ }
+}
+
+// PR5227.
+namespace PR5227 {
+void f(int &a) {
+ (a = 10) = 20;
+}
+}