Skip to content

Commit

Permalink
Issue #2130 Tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
tombentley committed Apr 22, 2015
1 parent d367068 commit 569d3b2
Show file tree
Hide file tree
Showing 16 changed files with 1,163 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public final class innerMethodInvocation_ {
final fib_ fib = new fib_();
final long $ceylontmp$start$1 = 0L;
final long $ceylontmp$end$2 = 50L;
final boolean $ceylontmp$increasing$3 = $ceylontmp$start$1 <= $ceylontmp$end$2;
final boolean $ceylontmp$increasing$3 = .ceylon.language.Integer.offset($ceylontmp$end$2, $ceylontmp$start$1) >= 0;
final long $ceylontmp$incr$4 = $ceylontmp$increasing$3 ? 1L : -1L;
loop_0: for (long n$5 = $ceylontmp$start$1; $ceylontmp$increasing$3 ? n$5 - $ceylontmp$end$2 <= 0L : n$5 - $ceylontmp$end$2 >= 0L; n$5 += $ceylontmp$incr$4) {
final long n = n$5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ final class bug1227_ifBreak_returnElse_opt_ {
boolean doforelse$13 = true;
final long $ceylontmp$start$14 = 1L;
final long $ceylontmp$end$15 = 10L;
final boolean $ceylontmp$increasing$16 = $ceylontmp$start$14 <= $ceylontmp$end$15;
final boolean $ceylontmp$increasing$16 = .ceylon.language.Integer.offset($ceylontmp$end$15, $ceylontmp$start$14) >= 0;
final long $ceylontmp$incr$17 = $ceylontmp$increasing$16 ? 1L : -1L;
loop_1: for (long index$18 = $ceylontmp$start$14; $ceylontmp$increasing$16 ? index$18 - $ceylontmp$end$15 <= 0L : index$18 - $ceylontmp$end$15 >= 0L; index$18 += $ceylontmp$incr$17) {
final long index = index$18;
Expand Down Expand Up @@ -147,7 +147,7 @@ final class bug1227_ifBreak_specifiedElse_opt_ {
boolean doforelse$35 = true;
final long $ceylontmp$start$36 = 1L;
final long $ceylontmp$end$37 = 10L;
final boolean $ceylontmp$increasing$38 = $ceylontmp$start$36 <= $ceylontmp$end$37;
final boolean $ceylontmp$increasing$38 = .ceylon.language.Integer.offset($ceylontmp$end$37, $ceylontmp$start$36) >= 0;
final long $ceylontmp$incr$39 = $ceylontmp$increasing$38 ? 1L : -1L;
loop_3: for (long index$40 = $ceylontmp$start$36; $ceylontmp$increasing$38 ? index$40 - $ceylontmp$end$37 <= 0L : index$40 - $ceylontmp$end$37 >= 0L; index$40 += $ceylontmp$incr$39) {
final long index = index$40;
Expand Down Expand Up @@ -254,7 +254,7 @@ final class bug1227_ifBreak_elseBreak_specifiedElse_opt_ {
boolean doforelse$59 = true;
final long $ceylontmp$start$60 = 1L;
final long $ceylontmp$end$61 = 10L;
final boolean $ceylontmp$increasing$62 = $ceylontmp$start$60 <= $ceylontmp$end$61;
final boolean $ceylontmp$increasing$62 = .ceylon.language.Integer.offset($ceylontmp$end$61, $ceylontmp$start$60) >= 0;
final long $ceylontmp$incr$63 = $ceylontmp$increasing$62 ? 1L : -1L;
loop_5: for (long index$64 = $ceylontmp$start$60; $ceylontmp$increasing$62 ? index$64 - $ceylontmp$end$61 <= 0L : index$64 - $ceylontmp$end$61 >= 0L; index$64 += $ceylontmp$incr$63) {
final long index = index$64;
Expand Down Expand Up @@ -366,7 +366,7 @@ final class bug1227_ifReturn_specifiedElse_opt_ {
long from$81 = 0L;
final long $ceylontmp$start$82 = 1L;
final long $ceylontmp$end$83 = 10L;
final boolean $ceylontmp$increasing$84 = $ceylontmp$start$82 <= $ceylontmp$end$83;
final boolean $ceylontmp$increasing$84 = .ceylon.language.Integer.offset($ceylontmp$end$83, $ceylontmp$start$82) >= 0;
final long $ceylontmp$incr$85 = $ceylontmp$increasing$84 ? 1L : -1L;
loop_7: for (long index$86 = $ceylontmp$start$82; $ceylontmp$increasing$84 ? index$86 - $ceylontmp$end$83 <= 0L : index$86 - $ceylontmp$end$83 >= 0L; index$86 += $ceylontmp$incr$85) {
final long index = index$86;
Expand Down Expand Up @@ -447,7 +447,7 @@ final class bug1227_ifThrow_specifiedElse_opt_ {
long from$102 = 0L;
final long $ceylontmp$start$103 = 1L;
final long $ceylontmp$end$104 = 10L;
final boolean $ceylontmp$increasing$105 = $ceylontmp$start$103 <= $ceylontmp$end$104;
final boolean $ceylontmp$increasing$105 = .ceylon.language.Integer.offset($ceylontmp$end$104, $ceylontmp$start$103) >= 0;
final long $ceylontmp$incr$106 = $ceylontmp$increasing$105 ? 1L : -1L;
loop_9: for (long index$107 = $ceylontmp$start$103; $ceylontmp$increasing$105 ? index$107 - $ceylontmp$end$104 <= 0L : index$107 - $ceylontmp$end$104 >= 0L; index$107 += $ceylontmp$incr$106) {
final long index = index$107;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public final class bug1438_ {
boolean doforelse$2 = true;
final long $ceylontmp$start$3 = 0L;
final long $ceylontmp$end$4 = 10L;
final boolean $ceylontmp$increasing$5 = $ceylontmp$start$3 <= $ceylontmp$end$4;
final boolean $ceylontmp$increasing$5 = .ceylon.language.Integer.offset($ceylontmp$end$4, $ceylontmp$start$3) >= 0;
final long $ceylontmp$incr$6 = $ceylontmp$increasing$5 ? 1L : -1L;
loop_0: for (long i$7 = $ceylontmp$start$3; $ceylontmp$increasing$5 ? i$7 - $ceylontmp$end$4 <= 0L : i$7 - $ceylontmp$end$4 >= 0L; i$7 += $ceylontmp$incr$6) {
final long i = i$7;
Expand Down Expand Up @@ -51,7 +51,7 @@ public final class bug1438_2_ {
boolean doforelse$13 = true;
final long $ceylontmp$start$14 = 0L;
final long $ceylontmp$end$15 = 10L;
final boolean $ceylontmp$increasing$16 = $ceylontmp$start$14 <= $ceylontmp$end$15;
final boolean $ceylontmp$increasing$16 = .ceylon.language.Integer.offset($ceylontmp$end$15, $ceylontmp$start$14) >= 0;
final long $ceylontmp$incr$17 = $ceylontmp$increasing$16 ? 1L : -1L;
loop_1: for (long i$18 = $ceylontmp$start$14; $ceylontmp$increasing$16 ? i$18 - $ceylontmp$end$15 <= 0L : i$18 - $ceylontmp$end$15 >= 0L; i$18 += $ceylontmp$incr$17) {
final long i = i$18;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ final class bug1507_ {
boolean doforelse$2 = true;
final long $ceylontmp$start$3 = 0L;
final long $ceylontmp$end$4 = new .java.util.Random().nextInt(.com.redhat.ceylon.compiler.java.Util.toInt(10L));
final boolean $ceylontmp$increasing$5 = $ceylontmp$start$3 <= $ceylontmp$end$4;
final boolean $ceylontmp$increasing$5 = .ceylon.language.Integer.offset($ceylontmp$end$4, $ceylontmp$start$3) >= 0;
final long $ceylontmp$incr$6 = $ceylontmp$increasing$5 ? 1L : -1L;
loop_0: for (long j$7 = $ceylontmp$start$3; $ceylontmp$increasing$5 ? j$7 - $ceylontmp$end$4 <= 0L : j$7 - $ceylontmp$end$4 >= 0L; j$7 += $ceylontmp$incr$6) {
final long j = j$7;
Expand Down Expand Up @@ -241,7 +241,7 @@ final class bug1507test6_ {
boolean doforelse$51 = true;
final long $ceylontmp$start$52 = 1L;
final long $ceylontmp$end$53 = 2L;
final boolean $ceylontmp$increasing$54 = $ceylontmp$start$52 <= $ceylontmp$end$53;
final boolean $ceylontmp$increasing$54 = .ceylon.language.Integer.offset($ceylontmp$end$53, $ceylontmp$start$52) >= 0;
final long $ceylontmp$incr$55 = $ceylontmp$increasing$54 ? 1L : -1L;
loop_6: for (long i$56 = $ceylontmp$start$52; $ceylontmp$increasing$54 ? i$56 - $ceylontmp$end$53 <= 0L : i$56 - $ceylontmp$end$53 >= 0L; i$56 += $ceylontmp$incr$55) {
final long i = i$56;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ final class keywordInForLoop_ {
static void keywordInForLoop(final .ceylon.language.Sequence<? extends .ceylon.language.Integer> seq) {
final long $ceylontmp$start$0 = 1L;
final long $ceylontmp$end$1 = 10L;
final boolean $ceylontmp$increasing$2 = $ceylontmp$start$0 <= $ceylontmp$end$1;
final boolean $ceylontmp$increasing$2 = .ceylon.language.Integer.offset($ceylontmp$end$1, $ceylontmp$start$0) >= 0;
final long $ceylontmp$incr$3 = $ceylontmp$increasing$2 ? 1L : -1L;
loop_0: for (long byte$4 = $ceylontmp$start$0; $ceylontmp$increasing$2 ? byte$4 - $ceylontmp$end$1 <= 0L : byte$4 - $ceylontmp$end$1 >= 0L; byte$4 += $ceylontmp$incr$3) {
final long $byte = byte$4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ public void testLopRangeOpIterationOptimizationCorrect(){

@Test
public void testLopOptimBug2130() {
//compareWithJavaSource("loop/optim/Bug2130");
compile("loop/optim/Bug2130.ceylon");
run("com.redhat.ceylon.compiler.java.test.statement.loop.optim.bug2130");
run("com.redhat.ceylon.compiler.java.test.statement.loop.optim.bug2130Span");
run("com.redhat.ceylon.compiler.java.test.statement.loop.optim.bug2130Measure");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ final class bug1878A_ {
static boolean bug1878A() {
final long $ceylontmp$start$0 = 1L;
final long $ceylontmp$end$1 = 1L;
final boolean $ceylontmp$increasing$2 = $ceylontmp$start$0 <= $ceylontmp$end$1;
final boolean $ceylontmp$increasing$2 = .ceylon.language.Integer.offset($ceylontmp$end$1, $ceylontmp$start$0) >= 0;
final long $ceylontmp$incr$3 = $ceylontmp$increasing$2 ? 1L : -1L;
loop_0: for (long _$4 = $ceylontmp$start$0; $ceylontmp$increasing$2 ? _$4 - $ceylontmp$end$1 <= 0L : _$4 - $ceylontmp$end$1 >= 0L; _$4 += $ceylontmp$incr$3) {
final long _ = _$4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final class bug1878Init_ {
static void bug1878Init() {
final long $ceylontmp$start$0 = 1L;
final long $ceylontmp$end$1 = 1L;
final boolean $ceylontmp$increasing$2 = $ceylontmp$start$0 <= $ceylontmp$end$1;
final boolean $ceylontmp$increasing$2 = .ceylon.language.Integer.offset($ceylontmp$end$1, $ceylontmp$start$0) >= 0;
final long $ceylontmp$incr$3 = $ceylontmp$increasing$2 ? 1L : -1L;
loop_0: for (long _$4 = $ceylontmp$start$0; $ceylontmp$increasing$2 ? _$4 - $ceylontmp$end$1 <= 0L : _$4 - $ceylontmp$end$1 >= 0L; _$4 += $ceylontmp$incr$3) {
final long _ = _$4;
Expand Down Expand Up @@ -56,7 +56,7 @@ class Bug1878 implements .com.redhat.ceylon.compiler.java.runtime.model.ReifiedT
private final void loopInit$priv$() {
final long $ceylontmp$start$5 = 1L;
final long $ceylontmp$end$6 = 1L;
final boolean $ceylontmp$increasing$7 = $ceylontmp$start$5 <= $ceylontmp$end$6;
final boolean $ceylontmp$increasing$7 = .ceylon.language.Integer.offset($ceylontmp$end$6, $ceylontmp$start$5) >= 0;
final long $ceylontmp$incr$8 = $ceylontmp$increasing$7 ? 1L : -1L;
loop_1: for (long _$9 = $ceylontmp$start$5; $ceylontmp$increasing$7 ? _$9 - $ceylontmp$end$6 <= 0L : _$9 - $ceylontmp$end$6 >= 0L; _$9 += $ceylontmp$incr$8) {
final long _ = _$9;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class MethodForRange implements .com.redhat.ceylon.compiler.java.runtime.model.R
public final void m() {
final long $ceylontmp$start$0 = 1L;
final long $ceylontmp$end$1 = 10L;
final boolean $ceylontmp$increasing$2 = $ceylontmp$start$0 <= $ceylontmp$end$1;
final boolean $ceylontmp$increasing$2 = .ceylon.language.Integer.offset($ceylontmp$end$1, $ceylontmp$start$0) >= 0;
final long $ceylontmp$incr$3 = $ceylontmp$increasing$2 ? 1L : -1L;
loop_0: for (long i$4 = $ceylontmp$start$0; $ceylontmp$increasing$2 ? i$4 - $ceylontmp$end$1 <= 0L : i$4 - $ceylontmp$end$1 >= 0L; i$4 += $ceylontmp$incr$3) {
final long i = i$4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Bug1467 implements .com.redhat.ceylon.compiler.java.runtime.model.ReifiedT
final long startTime = .ceylon.language.system_.get_().getNanoseconds();
final long $ceylontmp$start$3 = 1L;
final long $ceylontmp$end$4 = 100L;
final boolean $ceylontmp$increasing$5 = $ceylontmp$start$3 <= $ceylontmp$end$4;
final boolean $ceylontmp$increasing$5 = .ceylon.language.Integer.offset($ceylontmp$end$4, $ceylontmp$start$3) >= 0;
final long $ceylontmp$incr$6 = $ceylontmp$increasing$5 ? 1L : -1L;
loop_1: for (long i$7 = $ceylontmp$start$3; $ceylontmp$increasing$5 ? i$7 - $ceylontmp$end$4 <= 0L : i$7 - $ceylontmp$end$4 >= 0L; i$7 += $ceylontmp$incr$6) {
final long i = i$7;
Expand Down
Loading

0 comments on commit 569d3b2

Please sign in to comment.