changeset 733:476575c64be3

multiple init of cont values inside static this
author thomask
date Mon, 07 Nov 2005 04:26:11 +0000
parents d57c3dc1b36e
children d4edcc124e64
files run/c/const_26_A.d run/c/const_26_B.d
diffstat 2 files changed, 37 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/c/const_26_A.d	Mon Nov 07 04:26:11 2005 +0000
@@ -0,0 +1,19 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+module dstress.run.c.const_26_A;
+
+const int a, b;
+
+static this(){
+	a = b + 1;
+	b = a + 1;
+	a = b + 1;
+}
+
+int main(){
+	assert(a==3);
+	assert(b==2);
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/c/const_26_B.d	Mon Nov 07 04:26:11 2005 +0000
@@ -0,0 +1,18 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+module dstress.run.c.const_26_B;
+
+const int a;
+
+static this(){
+	a = 1;
+	a = 2;
+	a = 3;
+}
+
+int main(){
+	assert(a==3);
+	return 0;
+}