changeset 1120:d374abf09616

[Issue 287] DMD optimization bug arround dynamic array length Deewiant <deewiant@gmail.com> 2006-08-19 news:ec6kit$560$1@digitaldaemon.com
author thomask
date Sat, 26 Aug 2006 11:05:02 +0000
parents 72095373813d
children 48006b92f2b7
files run/o/odd_bug_07_C.d run/o/odd_bug_07_D.d run/o/odd_bug_07_E.d
diffstat 3 files changed, 93 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/o/odd_bug_07_C.d	Sat Aug 26 11:05:02 2006 +0000
@@ -0,0 +1,31 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @auhtor@	 Deewiant <deewiant@gmail.com>
+// @date@	2006-08-19
+// @uri@	news:ec6kit$560$1@digitaldaemon.com
+// @desc@	[Issue 287] DMD optimization bug arround dynamic array length
+
+module dstress.run.o.odd_bug_07_C;
+
+int main() {
+	int lng, lngnew;
+
+	int[] arr = new int[1];
+
+	for (int i = 10; i--;) {
+		lngnew = lng + arr.length;
+		lng = lngnew;
+
+		lngnew = lng + arr.length;
+
+		if(lng + 1 != lngnew){
+			assert(0);
+		}
+		
+		lng = lngnew;
+	}
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/o/odd_bug_07_D.d	Sat Aug 26 11:05:02 2006 +0000
@@ -0,0 +1,31 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @auhtor@	 Deewiant <deewiant@gmail.com>
+// @date@	2006-08-19
+// @uri@	news:ec6kit$560$1@digitaldaemon.com
+// @desc@	[Issue 287] DMD optimization bug arround dynamic array length
+
+module dstress.run.o.odd_bug_07_D;
+
+int main() {
+	int lng, lngnew;
+
+	int[] arr = new int[1];
+
+	for (int i = 10; i--;) {
+		lngnew = lng + arr.length;
+		lng = lngnew;
+
+		lngnew = lng + arr.length;
+
+		if(lng + 1 != lngnew){
+			assert(0);
+		}
+		
+		lng += arr.length;
+	}
+
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/o/odd_bug_07_E.d	Sat Aug 26 11:05:02 2006 +0000
@@ -0,0 +1,31 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @auhtor@	 Deewiant <deewiant@gmail.com>
+// @date@	2006-08-19
+// @uri@	news:ec6kit$560$1@digitaldaemon.com
+// @desc@	[Issue 287] DMD optimization bug arround dynamic array length
+
+module dstress.run.o.odd_bug_07_E;
+
+int main() {
+	int lng, lngnew;
+
+	int[] arr = new int[1];
+
+	for (int i = 10; i--;) {
+		lngnew = lng + arr.length;
+		lng = lngnew;
+
+		lngnew = lng + arr.length;
+
+		if(lng + 1 != lngnew){
+			assert(0);
+		}
+		
+		lng = lng + arr.length;
+	}
+
+	return 0;
+}