From 7a02cfcd25b1a29bcc8c3149ce022132e304f5b7 Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Sat, 26 May 2012 12:46:38 +0400 Subject: [PATCH] order of declaration changed in tests --- .../cfg/AnonymousInitializers.instructions | 26 +-- compiler/testData/cfg/Basic.instructions | 26 +-- compiler/testData/cfg/Finally.instructions | 126 +++++++------- .../cfg/LocalDeclarations.instructions | 156 ++++++------------ 4 files changed, 143 insertions(+), 191 deletions(-) diff --git a/compiler/testData/cfg/AnonymousInitializers.instructions b/compiler/testData/cfg/AnonymousInitializers.instructions index 32d8f65e3a2..d513fda9296 100644 --- a/compiler/testData/cfg/AnonymousInitializers.instructions +++ b/compiler/testData/cfg/AnonymousInitializers.instructions @@ -1,16 +1,3 @@ -== get_j == -get() = 20 ---------------------- -l0: - NEXT:[r(20)] PREV:[] - r(20) NEXT:[] PREV:[] -l1: - NEXT:[] PREV:[r(20)] -error: - NEXT:[] PREV:[] -sink: - NEXT:[] PREV:[, ] -===================== == AnonymousInitializers == class AnonymousInitializers() { val k = 34 @@ -59,3 +46,16 @@ error: sink: NEXT:[] PREV:[, ] ===================== +== get_j == +get() = 20 +--------------------- +l3: + NEXT:[r(20)] PREV:[] + r(20) NEXT:[] PREV:[] +l4: + NEXT:[] PREV:[r(20)] +error: + NEXT:[] PREV:[] +sink: + NEXT:[] PREV:[, ] +===================== diff --git a/compiler/testData/cfg/Basic.instructions b/compiler/testData/cfg/Basic.instructions index abd49b300ab..a3ddadb3a30 100644 --- a/compiler/testData/cfg/Basic.instructions +++ b/compiler/testData/cfg/Basic.instructions @@ -1,16 +1,3 @@ -== anonymous_0 == -{1} ---------------------- -l3: - NEXT:[r(1)] PREV:[] - r(1) NEXT:[] PREV:[] -l4: - NEXT:[] PREV:[r(1)] -error: - NEXT:[] PREV:[] -sink: - NEXT:[] PREV:[, ] -===================== == f == fun f(a : Boolean) : Unit { 1 @@ -91,6 +78,19 @@ error: sink: NEXT:[] PREV:[, ] ===================== +== anonymous_0 == +{1} +--------------------- +l3: + NEXT:[r(1)] PREV:[] + r(1) NEXT:[] PREV:[] +l4: + NEXT:[] PREV:[r(1)] +error: + NEXT:[] PREV:[] +sink: + NEXT:[] PREV:[, ] +===================== == foo == fun foo(a : Boolean, b : Int) : Unit {} --------------------- diff --git a/compiler/testData/cfg/Finally.instructions b/compiler/testData/cfg/Finally.instructions index d9ef32e086e..470a05454b2 100644 --- a/compiler/testData/cfg/Finally.instructions +++ b/compiler/testData/cfg/Finally.instructions @@ -69,33 +69,6 @@ error: sink: NEXT:[] PREV:[, ] ===================== -== anonymous_0 == -{ () => - if (2 > 3) { - return@ - } - } ---------------------- -l3: - NEXT:[r(())] PREV:[] - r(()) NEXT:[r(2)] PREV:[] - r(2) NEXT:[r(3)] PREV:[r(())] - r(3) NEXT:[r(>)] PREV:[r(2)] - r(>) NEXT:[r(2 > 3)] PREV:[r(3)] - r(2 > 3) NEXT:[jf(l5)] PREV:[r(>)] - jf(l5) NEXT:[read (Unit), ret l4] PREV:[r(2 > 3)] - ret l4 NEXT:[] PREV:[jf(l5)] -- jmp(l6) NEXT:[] PREV:[] -l5: - read (Unit) NEXT:[] PREV:[jf(l5)] -l4: -l6: - NEXT:[] PREV:[ret l4, read (Unit)] -error: - NEXT:[] PREV:[] -sink: - NEXT:[] PREV:[, ] -===================== == t3 == fun t3() { try { @@ -164,50 +137,32 @@ error: sink: NEXT:[] PREV:[, ] ===================== -== anonymous_1 == +== anonymous_0 == { () => - try { - 1 - if (2 > 3) { - return@ - } - } finally { - 2 + if (2 > 3) { + return@ + } } - } --------------------- l3: - NEXT:[r(())] PREV:[] - r(()) NEXT:[r(try { 1 if (2 > 3) { retur..)] PREV:[] - r(try { - 1 - if (2 > 3) { - return@ - } - } finally { - 2 - }) NEXT:[r(1)] PREV:[r(())] - r(1) NEXT:[r(2)] PREV:[r(try { 1 if (2 > 3) { retur..)] - r(2) NEXT:[r(3)] PREV:[r(1)] - r(3) NEXT:[r(>)] PREV:[r(2)] - r(>) NEXT:[r(2 > 3)] PREV:[r(3)] - r(2 > 3) NEXT:[jf(l5)] PREV:[r(>)] - jf(l5) NEXT:[read (Unit), r(2)] PREV:[r(2 > 3)] - r(2) NEXT:[ret l4] PREV:[jf(l5)] - ret l4 NEXT:[] PREV:[r(2)] -- jmp(l6) NEXT:[r(2)] PREV:[] + NEXT:[r(())] PREV:[] + r(()) NEXT:[r(2)] PREV:[] + r(2) NEXT:[r(3)] PREV:[r(())] + r(3) NEXT:[r(>)] PREV:[r(2)] + r(>) NEXT:[r(2 > 3)] PREV:[r(3)] + r(2 > 3) NEXT:[jf(l5)] PREV:[r(>)] + jf(l5) NEXT:[read (Unit), ret l4] PREV:[r(2 > 3)] + ret l4 NEXT:[] PREV:[jf(l5)] +- jmp(l6) NEXT:[] PREV:[] l5: - read (Unit) NEXT:[r(2)] PREV:[jf(l5)] -l6: -l7: - r(2) NEXT:[] PREV:[read (Unit)] + read (Unit) NEXT:[] PREV:[jf(l5)] l4: -l8: - NEXT:[] PREV:[ret l4, r(2)] +l6: + NEXT:[] PREV:[ret l4, read (Unit)] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] ===================== == t4 == fun t4() { @@ -286,6 +241,51 @@ error: sink: NEXT:[] PREV:[, ] ===================== +== anonymous_1 == +{ () => + try { + 1 + if (2 > 3) { + return@ + } + } finally { + 2 + } + } +--------------------- +l3: + NEXT:[r(())] PREV:[] + r(()) NEXT:[r(try { 1 if (2 > 3) { retur..)] PREV:[] + r(try { + 1 + if (2 > 3) { + return@ + } + } finally { + 2 + }) NEXT:[r(1)] PREV:[r(())] + r(1) NEXT:[r(2)] PREV:[r(try { 1 if (2 > 3) { retur..)] + r(2) NEXT:[r(3)] PREV:[r(1)] + r(3) NEXT:[r(>)] PREV:[r(2)] + r(>) NEXT:[r(2 > 3)] PREV:[r(3)] + r(2 > 3) NEXT:[jf(l5)] PREV:[r(>)] + jf(l5) NEXT:[read (Unit), r(2)] PREV:[r(2 > 3)] + r(2) NEXT:[ret l4] PREV:[jf(l5)] + ret l4 NEXT:[] PREV:[r(2)] +- jmp(l6) NEXT:[r(2)] PREV:[] +l5: + read (Unit) NEXT:[r(2)] PREV:[jf(l5)] +l6: +l7: + r(2) NEXT:[] PREV:[read (Unit)] +l4: +l8: + NEXT:[] PREV:[ret l4, r(2)] +error: + NEXT:[] PREV:[] +sink: + NEXT:[] PREV:[, ] +===================== == t5 == fun t5() { @ while(true) { diff --git a/compiler/testData/cfg/LocalDeclarations.instructions b/compiler/testData/cfg/LocalDeclarations.instructions index 500f605b982..388bf6cb715 100644 --- a/compiler/testData/cfg/LocalDeclarations.instructions +++ b/compiler/testData/cfg/LocalDeclarations.instructions @@ -29,53 +29,6 @@ error: sink: NEXT:[] PREV:[, ] ===================== -== O == -object O { - val x : Int - { - $x = 1 - } -} ---------------------- -l0: - NEXT:[v(val x : Int)] PREV:[] - v(val x : Int) NEXT:[r(1)] PREV:[] - r(1) NEXT:[w($x)] PREV:[v(val x : Int)] - w($x) NEXT:[] PREV:[r(1)] -l1: - NEXT:[] PREV:[w($x)] -error: - NEXT:[] PREV:[] -sink: - NEXT:[] PREV:[, ] -===================== -== null == -object { - val x : Int - - { - $x = 1 - } - - - fun foo() { - val b : Int = 1 - doSmth(b) - } - } ---------------------- -l0: - NEXT:[v(val x : Int)] PREV:[] - v(val x : Int) NEXT:[r(1)] PREV:[] - r(1) NEXT:[w($x)] PREV:[v(val x : Int)] - w($x) NEXT:[] PREV:[r(1)] -l1: - NEXT:[] PREV:[w($x)] -error: - NEXT:[] PREV:[] -sink: - NEXT:[] PREV:[, ] -===================== == doSmth == fun doSmth(i: Int) {} --------------------- @@ -126,6 +79,26 @@ error: sink: NEXT:[] PREV:[, ] ===================== +== O == +object O { + val x : Int + { + $x = 1 + } +} +--------------------- +l0: + NEXT:[v(val x : Int)] PREV:[] + v(val x : Int) NEXT:[r(1)] PREV:[] + r(1) NEXT:[w($x)] PREV:[v(val x : Int)] + w($x) NEXT:[] PREV:[r(1)] +l1: + NEXT:[] PREV:[w($x)] +error: + NEXT:[] PREV:[] +sink: + NEXT:[] PREV:[, ] +===================== == test2 == fun test2() { val b = 1 @@ -156,22 +129,6 @@ error: sink: NEXT:[] PREV:[, ] ===================== -== inner_bar == -fun inner_bar() { - y = 10 - } ---------------------- -l3: - NEXT:[r(10)] PREV:[] - r(10) NEXT:[w(y)] PREV:[] - w(y) NEXT:[] PREV:[r(10)] -l4: - NEXT:[] PREV:[w(y)] -error: - NEXT:[] PREV:[] -sink: - NEXT:[] PREV:[, ] -===================== == test3 == fun test3() { val a = object { @@ -220,8 +177,8 @@ error: sink: NEXT:[] PREV:[, ] ===================== -== ggg == -fun ggg() { +== inner_bar == +fun inner_bar() { y = 10 } --------------------- @@ -299,33 +256,17 @@ error: sink: NEXT:[] PREV:[, ] ===================== -== foo == -fun foo() { - x = 3 +== ggg == +fun ggg() { + y = 10 } --------------------- l3: - NEXT:[r(3)] PREV:[] - r(3) NEXT:[w(x)] PREV:[] - w(x) NEXT:[] PREV:[r(3)] + NEXT:[r(10)] PREV:[] + r(10) NEXT:[w(y)] PREV:[] + w(y) NEXT:[] PREV:[r(10)] l4: - NEXT:[] PREV:[w(x)] -error: - NEXT:[] PREV:[] -sink: - NEXT:[] PREV:[, ] -===================== -== bar == -fun bar() { - x = 4 - } ---------------------- -l6: - NEXT:[r(4)] PREV:[] - r(4) NEXT:[w(x)] PREV:[] - w(x) NEXT:[] PREV:[r(4)] -l7: - NEXT:[] PREV:[w(x)] + NEXT:[] PREV:[w(y)] error: NEXT:[] PREV:[] sink: @@ -418,22 +359,33 @@ sink: ===================== == foo == fun foo() { - val b : Int = 1 - doSmth(b) + x = 3 } --------------------- -l0: - NEXT:[v(val b : Int = 1)] PREV:[] - v(val b : Int = 1) NEXT:[r(1)] PREV:[] - r(1) NEXT:[w(b)] PREV:[v(val b : Int = 1)] - w(b) NEXT:[r(b)] PREV:[r(1)] - r(b) NEXT:[r(doSmth)] PREV:[w(b)] - r(doSmth) NEXT:[r(doSmth(b))] PREV:[r(b)] - r(doSmth(b)) NEXT:[] PREV:[r(doSmth)] -l1: - NEXT:[] PREV:[r(doSmth(b))] +l3: + NEXT:[r(3)] PREV:[] + r(3) NEXT:[w(x)] PREV:[] + w(x) NEXT:[] PREV:[r(3)] +l4: + NEXT:[] PREV:[w(x)] error: - NEXT:[] PREV:[] + NEXT:[] PREV:[] sink: - NEXT:[] PREV:[, ] + NEXT:[] PREV:[, ] +===================== +== bar == +fun bar() { + x = 4 + } +--------------------- +l6: + NEXT:[r(4)] PREV:[] + r(4) NEXT:[w(x)] PREV:[] + w(x) NEXT:[] PREV:[r(4)] +l7: + NEXT:[] PREV:[w(x)] +error: + NEXT:[] PREV:[] +sink: + NEXT:[] PREV:[, ] =====================