changeset 1555:01c289574a6d

DMD-1.011: ref
author thomask
date Mon, 23 Jul 2007 18:45:40 +0000
parents d54c617fdab4
children ca435c6f02c8
files nocompile/r/ref_01_B.d run/r/ref_01_A.d run/r/ref_01_C.d
diffstat 3 files changed, 33 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/nocompile/r/ref_01_B.d	Mon Jul 23 18:45:03 2007 +0000
+++ b/nocompile/r/ref_01_B.d	Mon Jul 23 18:45:40 2007 +0000
@@ -2,17 +2,15 @@
 // $Date$
 // $Author$
 
-// Porting: C#
-
-// __DSTRESS_ELINE__ 13
+// __DSTRESS_ELINE__ 14
 
 module dstress.nocompile.r.ref_01_B;
 
-void main(){
-	int i;
-	test(ref i);
+
+void test(ref int x){
 }
 
-void test(ref int i){
+int main(){
+	test(1);
+	return 0;
 }
-
--- a/run/r/ref_01_A.d	Mon Jul 23 18:45:03 2007 +0000
+++ b/run/r/ref_01_A.d	Mon Jul 23 18:45:40 2007 +0000
@@ -4,14 +4,18 @@
 
 module dstress.run.r.ref_01_A;
 
-void test(ref int i){
-	i++;
+
+void test(ref int x){
+	if(3 != x){
+		assert(0);
+	}
+	x++;
 }
 
 int main(){
-	int i = 2;
-	test(i);
-	if(3 != i){
+	int x = 3;
+	test(x);
+	if(4 != x){
 		assert(0);
 	}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/r/ref_01_C.d	Mon Jul 23 18:45:40 2007 +0000
@@ -0,0 +1,18 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+module dstress.run.r.ref_01_C;
+
+int main(){
+	char[] arr = "abc".dup;
+
+	foreach(ref element; arr){
+		element += 1;
+	}
+
+	if("bcd" != arr){
+		assert(0);
+	}
+	return 0;
+}