aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/loops.js48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/compress/loops.js b/test/compress/loops.js
index 5f3b927d..db0fbb9a 100644
--- a/test/compress/loops.js
+++ b/test/compress/loops.js
@@ -879,3 +879,51 @@ loop_return: {
}
expect_stdout: "foo 42"
}
+
+issue_3634_1: {
+ options = {
+ loops: true,
+ }
+ input: {
+ var b = 0;
+ L: while (++b < 2)
+ while (1)
+ if (b) break L;
+ console.log(b);
+ }
+ expect: {
+ var b = 0;
+ L: for (;++b < 2;)
+ for (;1;)
+ if (b) break L;
+ console.log(b);
+ }
+ expect_stdout: "1"
+}
+
+issue_3634_2: {
+ options = {
+ loops: true,
+ }
+ input: {
+ var b = 0;
+ L: while (++b < 2)
+ while (1)
+ if (!b)
+ continue L;
+ else
+ break L;
+ console.log(b);
+ }
+ expect: {
+ var b = 0;
+ L: for (;++b < 2;)
+ for (;1;)
+ if (!b)
+ continue L;
+ else
+ break L;
+ console.log(b);
+ }
+ expect_stdout: "1"
+}