From dd24fd47f732a4ac5028a2148501ce657af2b6f5 Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Thu, 10 Dec 2015 18:13:35 +0300 Subject: [PATCH] Update control flow test data for tower resolution algorithm - locals win - drop old invokeExtension convention --- .../conventions/bothReceivers.instructions | 30 +++++++++---------- .../testData/cfg/conventions/bothReceivers.kt | 4 +-- .../cfg/conventions/bothReceivers.values | 15 +++++----- .../cfg/conventions/getViaVar.instructions | 6 ++-- .../testData/cfg/conventions/getViaVar.values | 4 +-- .../cfg/conventions/setViaVar.instructions | 4 +-- .../testData/cfg/conventions/setViaVar.values | 16 +++++----- 7 files changed, 38 insertions(+), 41 deletions(-) diff --git a/compiler/testData/cfg/conventions/bothReceivers.instructions b/compiler/testData/cfg/conventions/bothReceivers.instructions index d42a92a9758..e9fb80b7676 100644 --- a/compiler/testData/cfg/conventions/bothReceivers.instructions +++ b/compiler/testData/cfg/conventions/bothReceivers.instructions @@ -40,26 +40,24 @@ sink: PREV:[, ] ===================== == foobar == -fun foobar(f: Foo) { - Bar().f() +fun Foo.foobar(bar: Bar) { + bar() } --------------------- L0: 1 - v(f: Foo) - magic[FAKE_INITIALIZER](f: Foo) -> - w(f|) - 2 mark({ Bar().f() }) - mark(Bar().f()) - r(f) -> - mark(Bar()) - call(Bar(), ) -> - mark(f()) - call(f(), invoke|, ) -> + v(bar: Bar) + magic[FAKE_INITIALIZER](bar: Bar) -> + w(bar|) + 2 mark({ bar() }) + r(bar) -> + magic[IMPLICIT_RECEIVER](bar()) -> + mark(bar()) + call(bar(), invoke|, ) -> L1: - 1 NEXT:[] + 1 NEXT:[] error: - PREV:[] + PREV:[] sink: - PREV:[, ] -===================== \ No newline at end of file + PREV:[, ] +===================== diff --git a/compiler/testData/cfg/conventions/bothReceivers.kt b/compiler/testData/cfg/conventions/bothReceivers.kt index 1ad462cb71d..2104e57bc23 100644 --- a/compiler/testData/cfg/conventions/bothReceivers.kt +++ b/compiler/testData/cfg/conventions/bothReceivers.kt @@ -5,6 +5,6 @@ class Foo() { fun Bar.invoke() {} } -fun foobar(f: Foo) { - Bar().f() +fun Foo.foobar(bar: Bar) { + bar() } \ No newline at end of file diff --git a/compiler/testData/cfg/conventions/bothReceivers.values b/compiler/testData/cfg/conventions/bothReceivers.values index d9c0e62cc0f..112449e0e93 100644 --- a/compiler/testData/cfg/conventions/bothReceivers.values +++ b/compiler/testData/cfg/conventions/bothReceivers.values @@ -14,14 +14,13 @@ fun Bar.invoke() {} --------------------- ===================== == foobar == -fun foobar(f: Foo) { - Bar().f() +fun Foo.foobar(bar: Bar) { + bar() } --------------------- - : Foo NEW: magic[FAKE_INITIALIZER](f: Foo) -> -Bar() : Bar NEW: call(Bar(), ) -> -f : Foo NEW: r(f) -> -f() : * NEW: call(f(), invoke|, ) -> -Bar().f() : * COPY -{ Bar().f() } : * COPY + : Bar NEW: magic[FAKE_INITIALIZER](bar: Bar) -> + : Foo NEW: magic[IMPLICIT_RECEIVER](bar()) -> +bar : Bar NEW: r(bar) -> +bar() : * NEW: call(bar(), invoke|, ) -> +{ bar() } : * COPY ===================== diff --git a/compiler/testData/cfg/conventions/getViaVar.instructions b/compiler/testData/cfg/conventions/getViaVar.instructions index 8eb26af0462..ff3816c549c 100644 --- a/compiler/testData/cfg/conventions/getViaVar.instructions +++ b/compiler/testData/cfg/conventions/getViaVar.instructions @@ -86,11 +86,11 @@ L0: w(get|) 2 mark({ foo[1] }) mark(foo[1]) - r(foo) -> - r(foo[1], get|) -> + r(foo[1], get) -> + r(foo) -> r(1) -> mark(foo[1]) - call(foo[1], invoke|, ) -> + call(foo[1], invoke|, , ) -> L1: 1 NEXT:[] error: diff --git a/compiler/testData/cfg/conventions/getViaVar.values b/compiler/testData/cfg/conventions/getViaVar.values index 07c89479ef0..30441f54865 100644 --- a/compiler/testData/cfg/conventions/getViaVar.values +++ b/compiler/testData/cfg/conventions/getViaVar.values @@ -35,8 +35,8 @@ fun test2(foo: Foo, get: Foo.(Int) -> Int) { --------------------- : Foo NEW: magic[FAKE_INITIALIZER](foo: Foo) -> : {<: Foo.(Int) -> Int} NEW: magic[FAKE_INITIALIZER](get: Foo.(Int) -> Int) -> -foo : Foo NEW: r(foo) -> +foo : Foo NEW: r(foo) -> 1 : Int NEW: r(1) -> -foo[1] : * NEW: call(foo[1], invoke|, ) -> +foo[1] : * NEW: call(foo[1], invoke|, , ) -> { foo[1] } : * COPY ===================== diff --git a/compiler/testData/cfg/conventions/setViaVar.instructions b/compiler/testData/cfg/conventions/setViaVar.instructions index 1552ebd8011..9ac1475e0d2 100644 --- a/compiler/testData/cfg/conventions/setViaVar.instructions +++ b/compiler/testData/cfg/conventions/setViaVar.instructions @@ -90,10 +90,10 @@ L0: 2 mark({ foo[1] = 2 }) mark(foo[1]) r(foo) -> - r(foo[1], set|) -> + r(foo[1], set) -> r(1) -> r(2) -> - call(foo[1] = 2, invoke|, , ) -> + call(foo[1] = 2, invoke|, , , ) -> L1: 1 NEXT:[] error: diff --git a/compiler/testData/cfg/conventions/setViaVar.values b/compiler/testData/cfg/conventions/setViaVar.values index 14d484ac143..90dcbd2e3d3 100644 --- a/compiler/testData/cfg/conventions/setViaVar.values +++ b/compiler/testData/cfg/conventions/setViaVar.values @@ -35,12 +35,12 @@ fun test2(foo: Foo, set: Foo.(Int, Int) -> Int) { foo[1] = 2 } --------------------- - : Foo NEW: magic[FAKE_INITIALIZER](foo: Foo) -> - : {<: Foo.(Int, Int) -> Int} NEW: magic[FAKE_INITIALIZER](set: Foo.(Int, Int) -> Int) -> -foo : Foo NEW: r(foo) -> -1 : Int NEW: r(1) -> -foo[1] : Bar NEW: r(foo[1], set|) -> -2 : Int NEW: r(2) -> -foo[1] = 2 : * NEW: call(foo[1] = 2, invoke|, , ) -> -{ foo[1] = 2 } : * COPY + : Foo NEW: magic[FAKE_INITIALIZER](foo: Foo) -> + : {<: Foo.(Int, Int) -> Int} NEW: magic[FAKE_INITIALIZER](set: Foo.(Int, Int) -> Int) -> +foo : Foo NEW: r(foo) -> +1 : Int NEW: r(1) -> +foo[1] : {<: (Foo, Int, Int) -> Int} NEW: r(foo[1], set) -> +2 : Int NEW: r(2) -> +foo[1] = 2 : * NEW: call(foo[1] = 2, invoke|, , , ) -> +{ foo[1] = 2 } : * COPY =====================