-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JVM] Port line number tests to stepping framework.
Allow specifying JVM and JVM_IR as well as shared expectations. Add the method name to the step. Discard steps in synthetic methods.
- Loading branch information
1 parent
4dbd4a5
commit 9fa1614
Showing
59 changed files
with
896 additions
and
540 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// FILE: test.kt | ||
|
||
fun box() { | ||
{ | ||
"OK" | ||
}() | ||
} | ||
|
||
// LINENUMBERS | ||
// test.kt:4 box | ||
// test.kt:5 invoke | ||
// test.kt:4 box | ||
// test.kt:7 box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// FILE: test.kt | ||
|
||
class A { | ||
val prop = 1 | ||
|
||
fun foo() { | ||
prop | ||
} | ||
} | ||
|
||
fun box() { | ||
val a = A() | ||
a.prop | ||
a.foo() | ||
} | ||
|
||
// TODO: The JVM_IR backend has an extra line number on the return. This causes line | ||
// three to be hit both on entry to the constructor and on exit after storing the | ||
// value of prop. | ||
|
||
// LINENUMBERS | ||
// test.kt:12 box | ||
// test.kt:3 <init> | ||
// test.kt:4 <init> | ||
// LINENUMBERS JVM_IR | ||
// test.kt:3 <init> | ||
// LINENUMBERS | ||
// test.kt:12 box | ||
// test.kt:13 box | ||
// test.kt:4 getProp | ||
// test.kt:13 box | ||
// test.kt:14 box | ||
// test.kt:7 foo | ||
// test.kt:8 foo | ||
// test.kt:15 box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// FILE: test.kt | ||
|
||
class A { | ||
companion object { | ||
val prop0 = 1 | ||
val prop1 = 2 | ||
fun foo(): Int { | ||
return prop0 + prop1 | ||
} | ||
} | ||
} | ||
|
||
fun box() { | ||
A.prop0 | ||
A.prop1 | ||
A.foo() | ||
} | ||
|
||
// The JVM version hits get getProp line numbers twice. That appears | ||
// to be because the synthetic accessibility bridges (access$getProp0$cp) | ||
// have line numbers (of the start of the surrounding class) in the JVM | ||
// version and they do not have line numbers in the JVM_IR version. | ||
|
||
// LINENUMBERS | ||
// test.kt:14 box | ||
// test.kt:5 getProp0 | ||
// LINENUMBERS JVM | ||
// test.kt:5 getProp0 | ||
// LINENUMBERS | ||
// test.kt:14 box | ||
// test.kt:15 box | ||
// test.kt:6 getProp1 | ||
// LINENUMBERS JVM | ||
// test.kt:6 getProp1 | ||
// LINENUMBERS | ||
// test.kt:15 box | ||
// test.kt:16 box | ||
// test.kt:8 foo | ||
// test.kt:5 getProp0 | ||
// LINENUMBERS JVM | ||
// test.kt:5 getProp0 | ||
// LINENUMBERS | ||
// test.kt:8 foo | ||
// test.kt:6 getProp1 | ||
// LINENUMBERS JVM | ||
// test.kt:6 getProp1 | ||
// LINENUMBERS | ||
// test.kt:8 foo | ||
// test.kt:16 box | ||
// test.kt:17 box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// FILE: test.kt | ||
|
||
class A { | ||
fun computeParam() = 32 | ||
|
||
fun foo(param: Int = computeParam()) { | ||
} | ||
} | ||
|
||
fun box() { | ||
A().foo() | ||
} | ||
|
||
// FORCE_STEP_INTO | ||
// LINENUMBERS | ||
// test.kt:11 box | ||
// test.kt:3 <init> | ||
// test.kt:11 box | ||
// test.kt:6 foo$default (synthetic) | ||
// test.kt:4 computeParam | ||
// test.kt:6 foo$default (synthetic) | ||
// test.kt:7 foo | ||
// test.kt:6 foo$default (synthetic) | ||
// test.kt:12 box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// FILE: test.kt | ||
|
||
enum class E { | ||
E1; | ||
|
||
fun foo() = { | ||
prop | ||
} | ||
|
||
val prop = 22 | ||
} | ||
|
||
fun box() { | ||
E.E1.foo() | ||
} | ||
|
||
// LINENUMBERS | ||
// test.kt:14 box | ||
// test.kt:6 foo | ||
// test.kt:8 foo | ||
// test.kt:14 box | ||
// test.kt:15 box |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// FILE: test.kt | ||
|
||
fun foo(x: Int) { | ||
if (x > 0) { | ||
"OK" | ||
} | ||
|
||
if (x > 0) else { | ||
"OK" | ||
} | ||
|
||
if (x > 0) { | ||
"OK" | ||
} else { | ||
"ALSO OK" | ||
} | ||
} | ||
|
||
fun box() { | ||
foo(1) | ||
foo(0) | ||
} | ||
|
||
// LINENUMBERS | ||
// test.kt:20 box | ||
// test.kt:4 foo | ||
// test.kt:5 foo | ||
// test.kt:8 foo | ||
// test.kt:12 foo | ||
// test.kt:13 foo | ||
// test.kt:17 foo | ||
// test.kt:21 box | ||
// test.kt:4 foo | ||
// test.kt:8 foo | ||
// test.kt:9 foo | ||
// test.kt:12 foo | ||
// test.kt:15 foo | ||
// test.kt:17 foo | ||
// test.kt:22 box |
Oops, something went wrong.