changeset 1461:030ce9dfefeb

[Issue 827] Trying to break out of a labelled BlockStatement breaks out of a for loop at its beginning Stewart Gordon <smjg@iname.com> 2007-01-10 http://d.puremagic.com/issues/show_bug.cgi?id=827
author thomask
date Thu, 05 Apr 2007 10:28:59 +0000
parents d0ab95b04926
children 4bf2a846ddf2
files nocompile/b/break_13_A.d nocompile/b/break_13_B.d
diffstat 2 files changed, 49 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/b/break_13_A.d	Thu Apr 05 10:28:59 2007 +0000
@@ -0,0 +1,23 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Stewart Gordon <smjg@iname.com>
+// @date@	2007-01-10
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=827
+// @desc@	[Issue 827] Trying to break out of a labelled BlockStatement breaks out of a for loop at its beginning
+
+// __DSTRESS_ELINE__ 18
+
+module dstress.nocompile.b.break_13_A;
+
+void foo() {
+	block: {
+		for (int i = 0; i < 10; i++) {
+			if (i == 5){
+				break block;
+			}
+		}
+		assert(0);
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/b/break_13_B.d	Thu Apr 05 10:28:59 2007 +0000
@@ -0,0 +1,26 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Stewart Gordon <smjg@iname.com>
+// @date@	2007-01-10
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=827
+// @desc@	[Issue 827] Trying to break out of a labelled BlockStatement breaks out of a for loop at its beginning
+
+// __DSTRESS_ELINE__ 21
+
+module dstress.nocompile.b.break_13_B;
+
+extern void bar();
+
+void foo() {
+	block: {
+		bar();
+		for (int i = 0; i < 10; i++) {
+			if (i == 5){
+				break block;
+			}
+		}
+		assert(0);
+	}
+}