Index: src/tests/.expect/references.txt
===================================================================
--- src/tests/.expect/references.txt	(revision aabc60c0994c2f07ad493223fedfaaf178c15bfe)
+++ src/tests/.expect/references.txt	(revision 12536d326cdd8c2ab4b6136a15a691b592594b07)
@@ -10,4 +10,26 @@
 Destructing a Y
 Destructing a Y
+Default constructing a Y
+Copy constructing a Y
+Value constructing a Y 56
+Value constructing a Y 78
+Copy constructing a Y
+Copy constructing a Y
+Assigning a Y
+Copy constructing a Y
 Destructing a Y
 Destructing a Y
+Copy constructing a Y
+Assigning a Y
+Copy constructing a Y
+Destructing a Y
+Destructing a Y
+Copy constructing a Y
+Destructing a Y
+Destructing a Y
+Destructing a Y
+Destructing a Y
+Destructing a Y
+Destructing a Y
+Destructing a Y
+Destructing a Y
Index: src/tests/references.c
===================================================================
--- src/tests/references.c	(revision aabc60c0994c2f07ad493223fedfaaf178c15bfe)
+++ src/tests/references.c	(revision 12536d326cdd8c2ab4b6136a15a691b592594b07)
@@ -19,4 +19,5 @@
 void ^?{}(Y & y) { printf("Destructing a Y\n"); }
 Y ?=?(Y & y, Y other) { printf("Assigning a Y\n"); return y; }
+void ?{}(Y & y, int i) { printf("Value constructing a Y %d\n", i); y.i = i; }
 
 struct X { Y & r; Y y; };
@@ -31,4 +32,7 @@
 }
 X ?=?(X & x, X other) { return x; }
+
+// ensure that generated functions do not implicitly operate on references
+struct Z { Y & r; Y y; };
 
 // test user-defined reference-returning function
@@ -67,4 +71,10 @@
 	X x1, x2 = x1;
 	x1 = x2;
+
+	Z z1, z2 = z1;
+	Y z1r = 56, z2r = 78;
+	&z1.r = &z1r;
+	&z2.r = &z2r;
+	z1 = z2;
 }
 
