blob: 00d3c602d3a292cbae16349f46608f131512ed47 [file] [log] [blame]
library /*isNonNullableByDefault*/;
import self as self;
import "dart:core" as core;
import "package:expect/expect.dart" as exp;
import "package:expect/expect.dart";
static const field core::int var1 = #C1;
static const field core::int var2 = #C2;
static const field core::int var3 = #C3;
static const field core::int var4 = #C4;
static const field core::int var5 = #C1;
static const field core::int var6 = #C5;
static const field core::int var7 = #C2;
static const field core::int var8 = #C6;
static const field core::int var9 = #C7;
static method fn(core::int a) core::int {
core::int b = a;
core::int i = 0;
while (i.{core::num::<}(2)) {
b = b.{core::num::+}(a);
i = i.{core::num::+}(1);
}
return b;
}
static method fn1(core::int a) core::int {
core::int b = a;
while (true) {
b = b.{core::num::*}(3);
if(b.{core::num::>}(10))
return b;
}
}
static method fnContinue() core::int {
core::int a = 0;
core::int i = 0;
while (i.{core::num::<}(5))
#L1:
{
if(i.{core::num::%}(2).{core::num::==}(1)) {
i = i.{core::num::+}(1);
break #L1;
}
a = a.{core::num::+}(i);
i = i.{core::num::+}(1);
}
return a;
}
static method fnBreak(core::int a) core::int {
core::int b = a;
core::int i = 0;
#L2:
while (i.{core::num::<}(2)) {
if(b.{core::num::==}(2))
break #L2;
b = b.{core::num::+}(a);
i = i.{core::num::+}(1);
}
return b;
}
static method fnNestedWhile() core::int {
core::int a = 0;
while (true) {
#L3:
while (true) {
break #L3;
}
return 1;
}
}
static method fnBreakLabel() core::int {
#L4:
while (true) {
while (true) {
break #L4;
}
}
return 3;
}
static method main() void {
exp::Expect::equals(#C1, 6);
exp::Expect::equals(#C2, 9);
exp::Expect::equals(#C3, 18);
exp::Expect::equals(#C4, 27);
exp::Expect::equals(#C1, 6);
exp::Expect::equals(#C5, 2);
exp::Expect::equals(#C2, 9);
exp::Expect::equals(#C6, 1);
exp::Expect::equals(#C7, 3);
}
constants {
#C1 = 6
#C2 = 9
#C3 = 18
#C4 = 27
#C5 = 2
#C6 = 1
#C7 = 3
}