changeset 593:6ee3b4b671c1

forach and throw/catch code generation Nick <Nick_member@pathlink.com> 2005-06-21 news:d99id2$fgj$1@digitaldaemon.com
author thomask
date Wed, 22 Jun 2005 17:15:46 +0000
parents 0a5d755db2c4
children 1f473003ec30
files run/c/catch_05_A.d run/c/catch_05_B.d run/c/catch_05_C.d run/c/catch_05_D.d run/c/catch_05_E.d run/c/catch_05_F.d run/c/catch_05_G.d
diffstat 7 files changed, 295 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/c/catch_05_A.d	Wed Jun 22 17:15:46 2005 +0000
@@ -0,0 +1,38 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Nick <Nick_member@pathlink.com>
+// @date@	2005-06-21
+// @uri@	news:d99id2$fgj$1@digitaldaemon.com
+// @desc@	foreach and throw/catch code generation
+
+module dstress.run.c.catch_05_A;
+
+void dummy(){
+}
+
+int bb[char[]];
+
+int main(){
+
+	foreach(char[] s, int i; bb){
+		dummy();
+	}
+
+	bb["a"] = 1;
+
+	foreach(int b; bb){
+		try{
+			throw new Error("foo");
+		}catch(Error e){
+			assert(e);
+			return 0;
+		}catch{
+			assert(0);
+		}
+		assert(0);
+	}
+
+	assert(0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/c/catch_05_B.d	Wed Jun 22 17:15:46 2005 +0000
@@ -0,0 +1,38 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Nick <Nick_member@pathlink.com>
+// @date@	2005-06-21
+// @uri@	news:d99id2$fgj$1@digitaldaemon.com
+// @desc@	foreach and throw/catch code generation
+
+module dstress.run.c.catch_05_B;
+
+void dummy(...){
+}
+
+int bb[char[]];
+
+int main(){
+
+	foreach(char[] s, int i; bb){
+		dummy();
+	}
+
+	bb["a"] = 1;
+
+	foreach(int b; bb){
+		try{
+			throw new Error("foo");
+		}catch(Error e){
+			assert(e);
+			return 0;
+		}catch{
+			assert(0);
+		}
+		assert(0);
+	}
+
+	assert(0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/c/catch_05_C.d	Wed Jun 22 17:15:46 2005 +0000
@@ -0,0 +1,48 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Nick <Nick_member@pathlink.com>
+// @date@	2005-06-21
+// @uri@	news:d99id2$fgj$1@digitaldaemon.com
+// @desc@	foreach and throw/catch code generation
+
+module dstress.run.c.catch_05_C;
+
+int counter;
+
+void dummy(){
+	counter++;
+}
+
+int bb[char[]];
+
+int main(){
+
+	bb["zwei"] = 2;
+
+	assert(counter==0);
+ 
+	foreach(char[] s, int i; bb){
+		dummy();
+	}
+
+	assert(counter==1);
+
+	bb["a"] = 1;
+
+	foreach(int b; bb){
+		try{
+			throw new Error("foo");
+		}catch(Error e){
+			assert(e);
+			assert(counter==1);
+			return 0;
+		}catch{
+			assert(0);
+		}
+		assert(0);
+	}
+
+	assert(0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/c/catch_05_D.d	Wed Jun 22 17:15:46 2005 +0000
@@ -0,0 +1,48 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Nick <Nick_member@pathlink.com>
+// @date@	2005-06-21
+// @uri@	news:d99id2$fgj$1@digitaldaemon.com
+// @desc@	foreach and throw/catch code generation
+
+module dstress.run.c.catch_05_D;
+
+int counter;
+
+void dummy(){
+	counter++;
+}
+
+int bb[char[]];
+
+int main(){
+
+	bb["zwei"] = 2;
+
+	assert(counter==0);
+ 
+	foreach(int i; bb){
+		dummy();
+	}
+
+	assert(counter==1);
+
+	bb["a"] = 1;
+
+	foreach(int b; bb){
+		try{
+			throw new Error("foo");
+		}catch(Error e){
+			assert(e);
+			assert(counter==1);
+			return 0;
+		}catch{
+			assert(0);
+		}
+		assert(0);
+	}
+
+	assert(0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/c/catch_05_E.d	Wed Jun 22 17:15:46 2005 +0000
@@ -0,0 +1,46 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Nick <Nick_member@pathlink.com>
+// @date@	2005-06-21
+// @uri@	news:d99id2$fgj$1@digitaldaemon.com
+// @desc@	foreach and throw/catch code generation
+
+module dstress.run.c.catch_05_E;
+
+int counter;
+
+void dummy(){
+	counter++;
+}
+
+int bb[char[]];
+
+int main(){
+
+	assert(counter==0);
+ 
+	foreach(int i; bb){
+		dummy();
+	}
+
+	assert(counter==0);
+
+	bb["a"] = 1;
+
+	foreach(int b; bb){
+		try{
+			throw new Error("foo");
+		}catch(Error e){
+			assert(e);
+			assert(counter==0);
+			return 0;
+		}catch{
+			assert(0);
+		}
+		assert(0);
+	}
+
+	assert(0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/c/catch_05_F.d	Wed Jun 22 17:15:46 2005 +0000
@@ -0,0 +1,46 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Nick <Nick_member@pathlink.com>
+// @date@	2005-06-21
+// @uri@	news:d99id2$fgj$1@digitaldaemon.com
+// @desc@	foreach and throw/catch code generation
+
+module dstress.run.c.catch_05_F;
+
+int counter;
+
+void dummy(...){
+	counter++;
+}
+
+int bb[char[]];
+
+int main(){
+
+	assert(counter==0);
+ 
+	foreach(int i; bb){
+		dummy(...);
+	}
+
+	assert(counter==0);
+
+	bb["a"] = 1;
+
+	foreach(int b; bb){
+		try{
+			throw new Error("foo");
+		}catch(Error e){
+			assert(e);
+			assert(counter==0);
+			return 0;
+		}catch{
+			assert(0);
+		}
+		assert(0);
+	}
+
+	assert(0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/c/catch_05_G.d	Wed Jun 22 17:15:46 2005 +0000
@@ -0,0 +1,31 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Nick <Nick_member@pathlink.com>
+// @date@	2005-06-21
+// @uri@	news:d99id2$fgj$1@digitaldaemon.com
+// @desc@	foreach and throw/catch code generation
+
+module dstress.run.c.catch_05_G;
+
+int bb[char[]];
+
+int main(){
+
+	bb["a"] = 1;
+
+	foreach(int b; bb){
+		try{
+			throw new Error("foo");
+		}catch(Error e){
+			assert(e);
+			return 0;
+		}catch{
+			assert(0);
+		}
+		assert(0);
+	}
+
+	assert(0);
+}