[JVM] Port remaining line number tests to stepping infrastructure.
These line number tests only tested that a set of line numbers where present in the java bytecode. Not that they would be hit in the right order by the debugger. Moving them to stepping tests fixes that. This exposes a couple of issues (in particular around try-catch-finally) that should be fixed. A number of tests are marked as failing now. Will investigate and work on fixes next.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
// FILE: test.kt
|
||||
|
||||
var current = true
|
||||
|
||||
fun alternate(): Boolean {
|
||||
current = !current
|
||||
return current
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
while (true) {
|
||||
if (alternate()) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun box() {
|
||||
foo()
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:19 box
|
||||
// test.kt:11 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:6 alternate
|
||||
// test.kt:7 alternate
|
||||
// test.kt:12 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:6 alternate
|
||||
// test.kt:7 alternate
|
||||
// test.kt:12 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:16 foo
|
||||
// test.kt:20 box
|
||||
@@ -0,0 +1,33 @@
|
||||
// FILE: test.kt
|
||||
|
||||
class A
|
||||
|
||||
fun bar(a: A) = A()
|
||||
|
||||
fun box() {
|
||||
val a = A()
|
||||
bar(
|
||||
bar(
|
||||
bar(a)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:8 box
|
||||
// test.kt:3 <init>
|
||||
// test.kt:8 box
|
||||
// test.kt:11 box
|
||||
// test.kt:5 bar
|
||||
// test.kt:3 <init>
|
||||
// test.kt:5 bar
|
||||
// test.kt:10 box
|
||||
// test.kt:5 bar
|
||||
// test.kt:3 <init>
|
||||
// test.kt:5 bar
|
||||
// test.kt:9 box
|
||||
// test.kt:5 bar
|
||||
// test.kt:3 <init>
|
||||
// test.kt:5 bar
|
||||
// test.kt:9 box
|
||||
// test.kt:14 box
|
||||
@@ -0,0 +1,28 @@
|
||||
// FILE: test.kt
|
||||
|
||||
class A {
|
||||
fun foo() = this
|
||||
inline fun bar() = this
|
||||
}
|
||||
|
||||
fun box() {
|
||||
val a = A()
|
||||
a
|
||||
.foo()
|
||||
|
||||
a
|
||||
.bar()
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:9 box
|
||||
// test.kt:3 <init>
|
||||
// test.kt:9 box
|
||||
// test.kt:10 box
|
||||
// test.kt:11 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:11 box
|
||||
// test.kt:13 box
|
||||
// test.kt:14 box
|
||||
// test.kt:5 box
|
||||
// test.kt:15 box
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
// FILE: test.kt
|
||||
|
||||
class A {
|
||||
fun foo() = this
|
||||
inline fun bar() = this
|
||||
}
|
||||
|
||||
fun box() {
|
||||
val a = A()
|
||||
a.foo()
|
||||
.foo()
|
||||
|
||||
a.bar()
|
||||
.bar()
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:9 box
|
||||
// test.kt:3 <init>
|
||||
// test.kt:9 box
|
||||
// test.kt:10 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:11 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:11 box
|
||||
// test.kt:13 box
|
||||
// test.kt:5 box
|
||||
// test.kt:14 box
|
||||
// test.kt:5 box
|
||||
// test.kt:15 box
|
||||
@@ -0,0 +1,14 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun box() {
|
||||
val x =
|
||||
42
|
||||
}
|
||||
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// The JVM_IR backend does not hit line 4. That should be fixed.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:5 box
|
||||
// test.kt:4 box
|
||||
// test.kt:6 box
|
||||
@@ -0,0 +1,32 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun box() {
|
||||
foo()
|
||||
bar()
|
||||
}
|
||||
|
||||
fun foo(i: Int = 1) {
|
||||
}
|
||||
|
||||
inline fun bar(i: Int = 1) {
|
||||
}
|
||||
|
||||
// TODO: The JVM_IR backend has line number 11 for the inlined
|
||||
// default argument handling both before and after the actual
|
||||
// body of bar. That is consistent with what happens with the
|
||||
// $default method in the non-inlined case, but it is not what
|
||||
// happens with the JVM backend.
|
||||
|
||||
// FORCE_STEP_INTO
|
||||
// LINENUMBERS
|
||||
// test.kt:4 box
|
||||
// test.kt:8 foo$default (synthetic)
|
||||
// test.kt:9 foo
|
||||
// test.kt:8 foo$default (synthetic)
|
||||
// test.kt:5 box
|
||||
// test.kt:11 box
|
||||
// test.kt:12 box
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:11 box
|
||||
// LINENUMBERS
|
||||
// test.kt:6 box
|
||||
@@ -0,0 +1,31 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun box() {
|
||||
foo({
|
||||
val a = 1
|
||||
})
|
||||
|
||||
foo() {
|
||||
val a = 1
|
||||
}
|
||||
}
|
||||
|
||||
inline fun foo(f: () -> Unit) {
|
||||
val a = 1
|
||||
f()
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:4 box
|
||||
// test.kt:14 box
|
||||
// test.kt:15 box
|
||||
// test.kt:5 box
|
||||
// test.kt:6 box
|
||||
// test.kt:16 box
|
||||
// test.kt:8 box
|
||||
// test.kt:14 box
|
||||
// test.kt:15 box
|
||||
// test.kt:9 box
|
||||
// test.kt:10 box
|
||||
// test.kt:16 box
|
||||
// test.kt:11 box
|
||||
@@ -0,0 +1,30 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun box() {
|
||||
foo({
|
||||
val a = 1
|
||||
})
|
||||
|
||||
foo() {
|
||||
val a = 1
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(f: () -> Unit) {
|
||||
f()
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:4 box
|
||||
// test.kt:14 foo
|
||||
// test.kt:5 invoke
|
||||
// test.kt:6 invoke
|
||||
// test.kt:14 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:8 box
|
||||
// test.kt:14 foo
|
||||
// test.kt:9 invoke
|
||||
// test.kt:10 invoke
|
||||
// test.kt:14 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:11 box
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo() {
|
||||
if (flag) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
var flag = true
|
||||
|
||||
fun box() {
|
||||
foo()
|
||||
flag = false
|
||||
foo()
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:12 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:13 box
|
||||
// test.kt:14 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:7 foo
|
||||
// test.kt:15 box
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo() {
|
||||
if (flag) {
|
||||
"OK"
|
||||
} else {
|
||||
"OK"
|
||||
}
|
||||
|
||||
val b = if (flag) {
|
||||
"OK"
|
||||
} else {
|
||||
"OK"
|
||||
}
|
||||
}
|
||||
|
||||
var flag = true
|
||||
|
||||
fun box() {
|
||||
foo()
|
||||
flag = false
|
||||
foo()
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:20 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:21 box
|
||||
// test.kt:22 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:7 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:23 box
|
||||
@@ -0,0 +1,36 @@
|
||||
// FILE: test.kt
|
||||
|
||||
var value = false
|
||||
|
||||
fun cond() = value
|
||||
|
||||
fun foo() {
|
||||
if (cond())
|
||||
cond()
|
||||
else
|
||||
false
|
||||
}
|
||||
|
||||
fun box() {
|
||||
foo()
|
||||
value = true
|
||||
foo()
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:15 box
|
||||
// test.kt:8 foo
|
||||
// test.kt:5 cond
|
||||
// test.kt:8 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:16 box
|
||||
// test.kt:17 box
|
||||
// test.kt:8 foo
|
||||
// test.kt:5 cond
|
||||
// test.kt:8 foo
|
||||
// test.kt:9 foo
|
||||
// test.kt:5 cond
|
||||
// test.kt:9 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:18 box
|
||||
@@ -0,0 +1,34 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun box() {
|
||||
bar {
|
||||
nop()
|
||||
baz()
|
||||
}
|
||||
}
|
||||
|
||||
inline fun bar(f: () -> Unit) {
|
||||
nop()
|
||||
f()
|
||||
}
|
||||
|
||||
inline fun baz() {
|
||||
nop()
|
||||
}
|
||||
|
||||
fun nop() {}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:4 box
|
||||
// test.kt:11 box
|
||||
// test.kt:19 nop
|
||||
// test.kt:12 box
|
||||
// test.kt:5 box
|
||||
// test.kt:19 nop
|
||||
// test.kt:6 box
|
||||
// test.kt:16 box
|
||||
// test.kt:19 nop
|
||||
// test.kt:17 box
|
||||
// test.kt:7 box
|
||||
// test.kt:13 box
|
||||
// test.kt:8 box
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
// FILE: test.kt
|
||||
|
||||
class Foo {
|
||||
var a: String
|
||||
|
||||
init {
|
||||
a = x()
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
init {
|
||||
val a = 5
|
||||
}
|
||||
|
||||
init {
|
||||
val b = 2
|
||||
}
|
||||
}
|
||||
|
||||
class Boo {
|
||||
init {
|
||||
val a = 5
|
||||
}
|
||||
|
||||
val x = x()
|
||||
|
||||
init {
|
||||
val b = 2
|
||||
}
|
||||
}
|
||||
|
||||
class Zoo {
|
||||
init { val a = 5 }
|
||||
|
||||
init { val b = 6 }
|
||||
|
||||
init {
|
||||
val c = 7
|
||||
}
|
||||
|
||||
init { val d = 8 }
|
||||
}
|
||||
|
||||
fun x() = ""
|
||||
|
||||
fun box() {
|
||||
Foo()
|
||||
Bar()
|
||||
Boo()
|
||||
Zoo()
|
||||
}
|
||||
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// The JVM_IR does not generate code that will break on the line
|
||||
// containing the `init`, nor the exit from the `init`. It only
|
||||
// contains lines for the contents of the init blocks.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:48 box
|
||||
// test.kt:3 <init>
|
||||
// test.kt:6 <init>
|
||||
// test.kt:7 <init>
|
||||
// test.kt:45 x
|
||||
// test.kt:7 <init>
|
||||
// test.kt:8 <init>
|
||||
// test.kt:48 box
|
||||
// test.kt:49 box
|
||||
// test.kt:11 <init>
|
||||
// test.kt:12 <init>
|
||||
// test.kt:13 <init>
|
||||
// test.kt:14 <init>
|
||||
// test.kt:16 <init>
|
||||
// test.kt:17 <init>
|
||||
// test.kt:18 <init>
|
||||
// test.kt:49 box
|
||||
// test.kt:50 box
|
||||
// test.kt:21 <init>
|
||||
// test.kt:22 <init>
|
||||
// test.kt:23 <init>
|
||||
// test.kt:24 <init>
|
||||
// test.kt:26 <init>
|
||||
// test.kt:45 x
|
||||
// test.kt:26 <init>
|
||||
// test.kt:28 <init>
|
||||
// test.kt:29 <init>
|
||||
// test.kt:30 <init>
|
||||
// test.kt:50 box
|
||||
// test.kt:51 box
|
||||
// test.kt:33 <init>
|
||||
// test.kt:34 <init>
|
||||
// test.kt:36 <init>
|
||||
// test.kt:38 <init>
|
||||
// test.kt:39 <init>
|
||||
// test.kt:40 <init>
|
||||
// test.kt:42 <init>
|
||||
// test.kt:51 box
|
||||
// test.kt:52 box
|
||||
@@ -0,0 +1,16 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun box() {
|
||||
foo(
|
||||
1 + 1
|
||||
)
|
||||
}
|
||||
|
||||
fun foo(i: Int) {
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:5 box
|
||||
// test.kt:4 box
|
||||
// test.kt:10 foo
|
||||
// test.kt:7 box
|
||||
@@ -0,0 +1,16 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun box() {
|
||||
1 foo
|
||||
1
|
||||
}
|
||||
|
||||
infix fun Int.foo(i: Int) {
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:4 box
|
||||
// test.kt:5 box
|
||||
// test.kt:4 box
|
||||
// test.kt:9 foo
|
||||
// test.kt:6 box
|
||||
@@ -0,0 +1,20 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun box() {
|
||||
lookAtMe {
|
||||
42
|
||||
}
|
||||
}
|
||||
|
||||
inline fun lookAtMe(f: () -> Int) {
|
||||
val a = 21
|
||||
a + f()
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:4 box
|
||||
// test.kt:10 box
|
||||
// test.kt:11 box
|
||||
// test.kt:5 box
|
||||
// test.kt:12 box
|
||||
// test.kt:7 box
|
||||
@@ -0,0 +1,12 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun box(): String {
|
||||
42!!
|
||||
42.toLong()!!
|
||||
return "OK"!!
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:4 box
|
||||
// test.kt:5 box
|
||||
// test.kt:6 box
|
||||
@@ -0,0 +1,38 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun box(){
|
||||
checkEquals(test(),
|
||||
fail())
|
||||
|
||||
checkEquals(fail(),
|
||||
test())
|
||||
}
|
||||
|
||||
public fun checkEquals(p1: String, p2: String) {
|
||||
"check"
|
||||
}
|
||||
|
||||
inline fun test() : String {
|
||||
return "123"
|
||||
}
|
||||
|
||||
fun fail() : String {
|
||||
return "fail"
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:4 box
|
||||
// test.kt:16 box
|
||||
// test.kt:5 box
|
||||
// test.kt:20 fail
|
||||
// test.kt:4 box
|
||||
// test.kt:12 checkEquals
|
||||
// test.kt:13 checkEquals
|
||||
// test.kt:7 box
|
||||
// test.kt:20 fail
|
||||
// test.kt:8 box
|
||||
// test.kt:16 box
|
||||
// test.kt:7 box
|
||||
// test.kt:12 checkEquals
|
||||
// test.kt:13 checkEquals
|
||||
// test.kt:9 box
|
||||
@@ -0,0 +1,36 @@
|
||||
// FILE: test.kt
|
||||
|
||||
infix fun String.execute(p: String) = this + p
|
||||
|
||||
fun box(){
|
||||
test() execute
|
||||
fail()
|
||||
|
||||
fail() execute
|
||||
test()
|
||||
}
|
||||
|
||||
inline fun test() : String {
|
||||
return "123"
|
||||
}
|
||||
|
||||
fun fail() : String {
|
||||
return "fail"
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:6 box
|
||||
// test.kt:14 box
|
||||
// test.kt:7 box
|
||||
// test.kt:18 fail
|
||||
// test.kt:6 box
|
||||
// test.kt:3 execute
|
||||
// test.kt:6 box
|
||||
// test.kt:9 box
|
||||
// test.kt:18 fail
|
||||
// test.kt:10 box
|
||||
// test.kt:14 box
|
||||
// test.kt:9 box
|
||||
// test.kt:3 execute
|
||||
// test.kt:9 box
|
||||
// test.kt:11 box
|
||||
@@ -0,0 +1,38 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun box(){
|
||||
test(test("1", "2"),
|
||||
fail())
|
||||
|
||||
test(fail(),
|
||||
test("1", "2"))
|
||||
}
|
||||
|
||||
public fun checkEquals(p1: String, p2: String) {
|
||||
"check"
|
||||
}
|
||||
|
||||
inline fun test(p: String, s: String) : String {
|
||||
return "123"
|
||||
}
|
||||
|
||||
fun fail() : String {
|
||||
return "fail"
|
||||
}
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:4 box
|
||||
// test.kt:16 box
|
||||
// test.kt:5 box
|
||||
// test.kt:20 fail
|
||||
// test.kt:5 box
|
||||
// test.kt:4 box
|
||||
// test.kt:16 box
|
||||
// test.kt:7 box
|
||||
// test.kt:20 fail
|
||||
// test.kt:7 box
|
||||
// test.kt:8 box
|
||||
// test.kt:16 box
|
||||
// test.kt:7 box
|
||||
// test.kt:16 box
|
||||
// test.kt:9 box
|
||||
@@ -0,0 +1,37 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun box(){
|
||||
test() +
|
||||
fail()
|
||||
|
||||
fail() +
|
||||
test()
|
||||
}
|
||||
|
||||
inline fun test() : String {
|
||||
return "123"
|
||||
}
|
||||
|
||||
fun fail() : String {
|
||||
return "fail"
|
||||
}
|
||||
|
||||
// IGNORE_BACKEND: JVM
|
||||
|
||||
// The JVM backend does not go back to line 4 and 7 for the
|
||||
// addition. Instead it treats the addition of the evaluated
|
||||
// arguments as being on line 5 and 8. That seems incorrect
|
||||
// and the JVM_IR stepping is more correct.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:4 box
|
||||
// test.kt:12 box
|
||||
// test.kt:5 box
|
||||
// test.kt:16 fail
|
||||
// test.kt:4 box
|
||||
// test.kt:7 box
|
||||
// test.kt:16 fail
|
||||
// test.kt:8 box
|
||||
// test.kt:12 box
|
||||
// test.kt:7 box
|
||||
// test.kt:9 box
|
||||
@@ -0,0 +1,73 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo() {
|
||||
try {
|
||||
mightThrow()
|
||||
} catch (e: Throwable) {
|
||||
return
|
||||
}
|
||||
|
||||
val t = try {
|
||||
mightThrow2()
|
||||
} catch (e: Throwable) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
var throw1 = false
|
||||
var throw2 = false
|
||||
|
||||
fun mightThrow() {
|
||||
if (throw1) throw Exception()
|
||||
}
|
||||
|
||||
fun mightThrow2() {
|
||||
if (throw2) throw Exception()
|
||||
}
|
||||
|
||||
fun box() {
|
||||
foo()
|
||||
throw2 = true
|
||||
foo()
|
||||
throw1 = true
|
||||
foo()
|
||||
}
|
||||
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// The JVM_IR backend will stop on line 13 even when mightThrow2
|
||||
// does not throw!
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:29 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:21 mightThrow
|
||||
// test.kt:22 mightThrow
|
||||
// test.kt:5 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:25 mightThrow2
|
||||
// test.kt:26 mightThrow2
|
||||
// test.kt:11 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:30 box
|
||||
// test.kt:31 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:21 mightThrow
|
||||
// test.kt:22 mightThrow
|
||||
// test.kt:5 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:25 mightThrow2
|
||||
// test.kt:12 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:32 box
|
||||
// test.kt:33 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:21 mightThrow
|
||||
// test.kt:6 foo
|
||||
// test.kt:7 foo
|
||||
// test.kt:34 box
|
||||
@@ -0,0 +1,96 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo() {
|
||||
try {
|
||||
mightThrow()
|
||||
} catch (e: Throwable) {
|
||||
"OK"
|
||||
} finally {
|
||||
"FINALLY"
|
||||
}
|
||||
|
||||
val t = try {
|
||||
mightThrow2()
|
||||
} catch (e: Throwable) {
|
||||
"OK2"
|
||||
} finally {
|
||||
"FINALLY2"
|
||||
}
|
||||
}
|
||||
|
||||
var throw1 = false
|
||||
var throw2 = false
|
||||
|
||||
fun mightThrow() {
|
||||
if (throw1) throw Exception()
|
||||
}
|
||||
|
||||
fun mightThrow2() {
|
||||
if (throw2) throw Exception()
|
||||
}
|
||||
|
||||
fun box() {
|
||||
foo()
|
||||
throw2 = true
|
||||
foo()
|
||||
throw1 = true
|
||||
foo()
|
||||
}
|
||||
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// The JVM_IR backend goes back to line 17 after line 18. It has the
|
||||
// sequence 17, 18, 17 which doesn't make sense.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:33 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:25 mightThrow
|
||||
// test.kt:26 mightThrow
|
||||
// test.kt:9 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:29 mightThrow2
|
||||
// test.kt:30 mightThrow2
|
||||
// test.kt:13 foo
|
||||
// test.kt:17 foo
|
||||
// test.kt:18 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:19 foo
|
||||
// test.kt:34 box
|
||||
// test.kt:35 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:25 mightThrow
|
||||
// test.kt:26 mightThrow
|
||||
// test.kt:9 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:29 mightThrow2
|
||||
// test.kt:14 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:17 foo
|
||||
// test.kt:18 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:19 foo
|
||||
// test.kt:36 box
|
||||
// test.kt:37 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:25 mightThrow
|
||||
// test.kt:6 foo
|
||||
// test.kt:7 foo
|
||||
// test.kt:9 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:29 mightThrow2
|
||||
// test.kt:14 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:17 foo
|
||||
// test.kt:18 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:19 foo
|
||||
// test.kt:38 box
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo() {
|
||||
try {
|
||||
mightThrow()
|
||||
} finally {
|
||||
"FINALLY"
|
||||
}
|
||||
|
||||
val t = try {
|
||||
mightThrow2()
|
||||
} finally {
|
||||
"FINALLY2"
|
||||
}
|
||||
}
|
||||
|
||||
var throw1 = false
|
||||
var throw2 = false
|
||||
|
||||
fun mightThrow() {
|
||||
if (throw1) throw Exception()
|
||||
}
|
||||
|
||||
fun mightThrow2() {
|
||||
if (throw2) throw Exception()
|
||||
}
|
||||
|
||||
fun box() {
|
||||
foo()
|
||||
throw2 = true
|
||||
foo()
|
||||
// Never gets here.
|
||||
throw1 = true
|
||||
foo()
|
||||
}
|
||||
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// The JVM_IR backend goes back to line 13 after line 14. It has the
|
||||
// sequence 13, 14, 13 which doesn't make sense.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:29 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:21 mightThrow
|
||||
// test.kt:22 mightThrow
|
||||
// test.kt:7 foo
|
||||
// test.kt:8 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:25 mightThrow2
|
||||
// test.kt:26 mightThrow2
|
||||
// test.kt:11 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:14 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:30 box
|
||||
// test.kt:31 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:21 mightThrow
|
||||
// test.kt:22 mightThrow
|
||||
// test.kt:7 foo
|
||||
// test.kt:8 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:25 mightThrow2
|
||||
// test.kt:14 foo
|
||||
// test.kt:13 foo
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo(x: Int) {
|
||||
when {
|
||||
x == 21 -> foo(42)
|
||||
x == 42 -> foo(63)
|
||||
else -> 1
|
||||
}
|
||||
|
||||
val t = when {
|
||||
x == 21 -> foo(42)
|
||||
x == 42 -> foo(63)
|
||||
else -> 2
|
||||
}
|
||||
}
|
||||
|
||||
fun box() {
|
||||
foo(21)
|
||||
}
|
||||
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
// The JVM_IR backend has line number 8 when leaving the first
|
||||
// when. Also, the stepping is different, probably because the when
|
||||
// is compiled to a switch which it isn't with JVM? The stepping
|
||||
// behavior is likely OK, but should be double checked.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:18 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:7 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:7 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:7 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:7 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:19 box
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
// FILE: test.kt
|
||||
|
||||
fun foo(x: Int) {
|
||||
when (x) {
|
||||
21 -> foo(42)
|
||||
42 -> foo(63)
|
||||
else -> 1
|
||||
}
|
||||
|
||||
val t = when (x) {
|
||||
21 -> foo(42)
|
||||
42 -> foo(63)
|
||||
else -> 1
|
||||
}
|
||||
}
|
||||
|
||||
fun box() {
|
||||
foo(21)
|
||||
}
|
||||
|
||||
// JVM_IR stops on line 8 when exiting the first when.
|
||||
|
||||
// LINENUMBERS
|
||||
// test.kt:18 box
|
||||
// test.kt:4 foo
|
||||
// test.kt:5 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:7 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:6 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:7 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:5 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:6 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:7 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:6 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:4 foo
|
||||
// test.kt:7 foo
|
||||
// LINENUMBERS JVM_IR
|
||||
// test.kt:8 foo
|
||||
// LINENUMBERS
|
||||
// test.kt:10 foo
|
||||
// test.kt:13 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:12 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:11 foo
|
||||
// test.kt:10 foo
|
||||
// test.kt:15 foo
|
||||
// test.kt:19 box
|
||||
@@ -1,13 +0,0 @@
|
||||
fun foo() {
|
||||
while (true) {
|
||||
if (testSome()) {
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun testSome(): Boolean {
|
||||
return false
|
||||
}
|
||||
|
||||
// 2 3 4 2 7 10
|
||||
@@ -1,17 +0,0 @@
|
||||
class A {
|
||||
fun foo(a: A) = a
|
||||
}
|
||||
|
||||
fun bar(a: A) = A()
|
||||
|
||||
fun foo() {
|
||||
val a = A()
|
||||
bar(
|
||||
bar(
|
||||
bar(a)
|
||||
)
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
// 2 1 5 8 9 +10 +11 10 9 15
|
||||
@@ -1,15 +0,0 @@
|
||||
class A {
|
||||
fun foo() = this
|
||||
inline fun bar() = this
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val a = A()
|
||||
a
|
||||
.foo()
|
||||
|
||||
a
|
||||
.bar()
|
||||
}
|
||||
|
||||
// 2 3 1 7 8 +9 +8 9 11 +12 +11 12 16 13
|
||||
@@ -1,15 +0,0 @@
|
||||
class A {
|
||||
fun foo() = this
|
||||
inline fun bar() = this
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
val a = A()
|
||||
a.foo()
|
||||
.foo()
|
||||
|
||||
a.bar()
|
||||
.bar()
|
||||
}
|
||||
|
||||
// 2 3 1 7 8 +9 +8 9 11 +12 +11 16 12 17 13
|
||||
@@ -1,6 +0,0 @@
|
||||
fun foo() {
|
||||
val x =
|
||||
42
|
||||
}
|
||||
|
||||
// 2 +3 2 4
|
||||
@@ -1,12 +0,0 @@
|
||||
fun test() {
|
||||
foo()
|
||||
bar()
|
||||
}
|
||||
|
||||
fun foo(i: Int = 1) {
|
||||
}
|
||||
|
||||
inline fun bar(i: Int = 1) {
|
||||
}
|
||||
|
||||
// 2 3 13 14 4 7 6 10 9 10
|
||||
@@ -1,16 +0,0 @@
|
||||
fun foo() {
|
||||
foo({
|
||||
val a = 1
|
||||
})
|
||||
|
||||
foo() {
|
||||
val a = 1
|
||||
}
|
||||
}
|
||||
|
||||
inline fun foo(f: () -> Unit) {
|
||||
val a = 1
|
||||
f()
|
||||
}
|
||||
|
||||
// 2 17 18 3 4 19 6 20 21 7 8 22 9 12 13 14
|
||||
@@ -1,15 +0,0 @@
|
||||
fun foo() {
|
||||
foo({
|
||||
val a = 1
|
||||
})
|
||||
|
||||
foo() {
|
||||
val a = 1
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(f: () -> Unit) {
|
||||
f()
|
||||
}
|
||||
|
||||
// 2 6 9 12 13 3 4 7 8
|
||||
@@ -1,9 +0,0 @@
|
||||
fun foo() {
|
||||
if (flag) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
val flag = true
|
||||
|
||||
// 2 3 5 7 7
|
||||
@@ -1,17 +0,0 @@
|
||||
fun foo() {
|
||||
if (flag) {
|
||||
System.out?.println()
|
||||
} else {
|
||||
System.out?.println()
|
||||
}
|
||||
|
||||
val b = if (flag) {
|
||||
System.out?.println()
|
||||
} else {
|
||||
System.out?.println()
|
||||
}
|
||||
}
|
||||
|
||||
val flag = true
|
||||
|
||||
// 2 3 5 6 +8 9 11 8 13 15 15
|
||||
@@ -1,10 +0,0 @@
|
||||
fun cond() = false
|
||||
|
||||
fun foo() {
|
||||
if (cond())
|
||||
cond()
|
||||
else
|
||||
false
|
||||
}
|
||||
|
||||
// 1 4 5 7 8
|
||||
@@ -1,19 +0,0 @@
|
||||
fun foo() {
|
||||
bar {
|
||||
nop()
|
||||
baz()
|
||||
}
|
||||
}
|
||||
|
||||
inline fun bar(f: () -> Unit) {
|
||||
nop()
|
||||
f()
|
||||
}
|
||||
|
||||
inline fun baz() {
|
||||
nop()
|
||||
}
|
||||
|
||||
fun nop() {}
|
||||
|
||||
// 2 20 21 3 4 22 23 5 24 6 9 10 11 14 15 17
|
||||
@@ -1,46 +0,0 @@
|
||||
class Foo {
|
||||
var a: String
|
||||
|
||||
init {
|
||||
a = x()
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
init {
|
||||
val a = 5
|
||||
}
|
||||
|
||||
init {
|
||||
val b = 2
|
||||
}
|
||||
}
|
||||
|
||||
class Boo {
|
||||
init {
|
||||
val a = 5
|
||||
}
|
||||
|
||||
val x = x()
|
||||
|
||||
init {
|
||||
val b = 2
|
||||
}
|
||||
}
|
||||
|
||||
class Zoo {
|
||||
init { val a = 5 }
|
||||
|
||||
init { val b = 6 }
|
||||
|
||||
init {
|
||||
val c = 7
|
||||
}
|
||||
|
||||
init { val d = 8 }
|
||||
}
|
||||
|
||||
fun x() = ""
|
||||
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// 2 2 1 4 5 6 9 10 11 12 14 15 16 24 19 20 21 22 24 26 27 28 31 32 34 36 37 38 40 43
|
||||
@@ -1,10 +0,0 @@
|
||||
fun foo() {
|
||||
foo(
|
||||
1 + 1
|
||||
)
|
||||
}
|
||||
|
||||
fun foo(i: Int) {
|
||||
}
|
||||
|
||||
// 2 +3 2 5 8
|
||||
@@ -1,9 +0,0 @@
|
||||
fun foo() {
|
||||
1 foo
|
||||
1
|
||||
}
|
||||
|
||||
infix fun Int.foo(i: Int) {
|
||||
}
|
||||
|
||||
// 2 3 2 4 7
|
||||
@@ -1,12 +0,0 @@
|
||||
fun box() {
|
||||
lookAtMe {
|
||||
42
|
||||
}
|
||||
}
|
||||
|
||||
inline fun lookAtMe(f: () -> Int) {
|
||||
val a = 21
|
||||
a + f()
|
||||
}
|
||||
|
||||
// 2 13 14 3 15 5 8 9 10
|
||||
@@ -1,7 +0,0 @@
|
||||
fun box(): String {
|
||||
42!!
|
||||
42.toLong()!!
|
||||
return "OK"!!
|
||||
}
|
||||
|
||||
// 2 3 4
|
||||
@@ -1,21 +0,0 @@
|
||||
fun box(){
|
||||
checkEquals(test(),
|
||||
fail())
|
||||
|
||||
checkEquals(fail(),
|
||||
test())
|
||||
}
|
||||
|
||||
public fun checkEquals(p1: String, p2: String) {
|
||||
throw AssertionError("fail")
|
||||
}
|
||||
|
||||
inline fun test() : String {
|
||||
return "123"
|
||||
}
|
||||
|
||||
fun fail() : String {
|
||||
throw AssertionError("fail")
|
||||
}
|
||||
|
||||
// 2 22 3 2 5 6 23 5 7 10 14 18
|
||||
@@ -1,19 +0,0 @@
|
||||
infix fun String.execute(p: String) = this + p
|
||||
|
||||
fun box(){
|
||||
test() execute
|
||||
fail()
|
||||
|
||||
fail() execute
|
||||
test()
|
||||
}
|
||||
|
||||
inline fun test() : String {
|
||||
return "123"
|
||||
}
|
||||
|
||||
fun fail() : String {
|
||||
throw AssertionError("fail")
|
||||
}
|
||||
|
||||
// 1 4 20 5 4 7 8 21 7 9 12 16
|
||||
@@ -1,21 +0,0 @@
|
||||
fun box(){
|
||||
test(test("1", "2"),
|
||||
fail())
|
||||
|
||||
test(fail(),
|
||||
test("1", "2"))
|
||||
}
|
||||
|
||||
public fun checkEquals(p1: String, p2: String) {
|
||||
throw AssertionError("fail")
|
||||
}
|
||||
|
||||
inline fun test(p: String, s: String) : String {
|
||||
return "123"
|
||||
}
|
||||
|
||||
fun fail() : String {
|
||||
throw AssertionError("fail")
|
||||
}
|
||||
|
||||
// 2 22 3 2 22 5 6 23 5 24 7 10 14 18
|
||||
@@ -1,17 +0,0 @@
|
||||
fun box(){
|
||||
test() +
|
||||
fail()
|
||||
|
||||
fail() +
|
||||
test()
|
||||
}
|
||||
|
||||
inline fun test() : String {
|
||||
return "123"
|
||||
}
|
||||
|
||||
fun fail() : String {
|
||||
throw AssertionError("fail")
|
||||
}
|
||||
|
||||
// 2 18 3 5 6 19 7 10 14
|
||||
@@ -1,15 +0,0 @@
|
||||
fun foo() {
|
||||
try {
|
||||
System.out?.println()
|
||||
} catch (e: Throwable) {
|
||||
return
|
||||
}
|
||||
|
||||
val t = try {
|
||||
System.out?.println()
|
||||
} catch (e: Throwable) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 2 3 4 5 6 +8 9 10 11 8 13
|
||||
@@ -1,19 +0,0 @@
|
||||
fun foo() {
|
||||
try {
|
||||
System.out?.println()
|
||||
} catch (e: Throwable) {
|
||||
System.out?.println()
|
||||
} finally {
|
||||
System.out?.println()
|
||||
}
|
||||
|
||||
val t = try {
|
||||
System.out?.println()
|
||||
} catch (e: Throwable) {
|
||||
System.out?.println()
|
||||
} finally {
|
||||
System.out?.println()
|
||||
}
|
||||
}
|
||||
|
||||
// 2 3 7 8 4 5 7 8 7 8 +10 11 15 16 12 13 15 16 15 10 17
|
||||
@@ -1,15 +0,0 @@
|
||||
fun foo() {
|
||||
try {
|
||||
System.out?.println()
|
||||
} finally {
|
||||
System.out?.println()
|
||||
}
|
||||
|
||||
val t = try {
|
||||
System.out?.println()
|
||||
} finally {
|
||||
System.out?.println()
|
||||
}
|
||||
}
|
||||
|
||||
// 2 3 5 6 5 6 +8 9 11 12 11 8 13
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
fun foo(x: Int) {
|
||||
when {
|
||||
x == 21 -> foo(x)
|
||||
x == 42 -> foo(x)
|
||||
else -> foo(x)
|
||||
}
|
||||
|
||||
val t = when {
|
||||
x == 21 -> foo(x)
|
||||
x == 42 -> foo(x)
|
||||
else -> foo(x)
|
||||
}
|
||||
}
|
||||
|
||||
// 2 3 4 5 6 +8 9 10 11 8 13
|
||||
@@ -1,19 +0,0 @@
|
||||
fun foo(x: Int) {
|
||||
when (x) {
|
||||
21 -> foo(x)
|
||||
42 -> foo(x)
|
||||
else -> foo(x)
|
||||
}
|
||||
|
||||
val t = when (x) {
|
||||
21 -> foo(x)
|
||||
42 -> foo(x)
|
||||
else -> foo(x)
|
||||
}
|
||||
}
|
||||
|
||||
// JVM_IR also generates a LINENUMBER 12, which seems consistent with the fact that
|
||||
// there is a LINENUMBER 6, but still fails the test.
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
|
||||
// 2 3 4 5 6 +8 9 10 11 8 13
|
||||
@@ -1,165 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.codegen
|
||||
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
|
||||
import org.jetbrains.org.objectweb.asm.*
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
import java.util.regex.Pattern
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
abstract class AbstractLineNumberTest : CodegenTestCase() {
|
||||
|
||||
override fun doMultiFileTest(wholeFile: File, files: List<TestFile>) {
|
||||
val isCustomTest = wholeFile.parentFile.name.equals("custom", ignoreCase = true)
|
||||
compile(if (!isCustomTest) files + createLineNumberDeclaration() else files)
|
||||
|
||||
val psiFile = myFiles.psiFiles.single { file -> file.name == wholeFile.name }
|
||||
|
||||
try {
|
||||
if (isCustomTest) {
|
||||
compareCustom(psiFile, wholeFile)
|
||||
} else {
|
||||
val expectedLineNumbers = extractSelectedLineNumbersFromSource(psiFile)
|
||||
val actualLineNumbers = extractActualLineNumbersFromBytecode(classFileFactory, true)
|
||||
assertFalse("Missed 'lineNumbers' calls in test data", expectedLineNumbers.isEmpty())
|
||||
KtUsefulTestCase.assertSameElements(actualLineNumbers, expectedLineNumbers)
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
printReport(wholeFile)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
|
||||
protected open fun compareCustom(psiFile: KtFile, wholeFile: File) {
|
||||
val actualLineNumbers = extractActualLineNumbersFromBytecode(classFileFactory, false)
|
||||
val text = psiFile.text
|
||||
val newFileText = text.substring(0 until Regex("// \\d+").find(text)!!.range.first) +
|
||||
getActualLineNumbersAsString(actualLineNumbers)
|
||||
KotlinTestUtils.assertEqualsToFile(wholeFile, newFileText)
|
||||
}
|
||||
|
||||
protected fun extractActualLineNumbersFromBytecode(factory: ClassFileFactory, testFunInvoke: Boolean) =
|
||||
factory.getClassFiles().flatMap { outputFile ->
|
||||
val cr = ClassReader(outputFile.asByteArray())
|
||||
if (testFunInvoke) readTestFunLineNumbers(cr) else readAllLineNumbers(cr)
|
||||
}
|
||||
|
||||
protected open fun readTestFunLineNumbers(cr: ClassReader): List<String> {
|
||||
val labels = arrayListOf<Label>()
|
||||
val labels2LineNumbers = HashMap<Label, String>()
|
||||
|
||||
val visitor = object : ClassVisitor(Opcodes.API_VERSION) {
|
||||
override fun visitMethod(
|
||||
access: Int,
|
||||
name: String,
|
||||
desc: String,
|
||||
signature: String?,
|
||||
exceptions: Array<String>?
|
||||
): MethodVisitor {
|
||||
return getTestFunLineNumbersMethodVisitor(labels, labels2LineNumbers)
|
||||
}
|
||||
}
|
||||
|
||||
cr.accept(visitor, ClassReader.SKIP_FRAMES)
|
||||
|
||||
return labels.map { label ->
|
||||
labels2LineNumbers[label] ?: error("No line number found for a label")
|
||||
}
|
||||
}
|
||||
|
||||
protected open fun getTestFunLineNumbersMethodVisitor(
|
||||
labels: ArrayList<Label>,
|
||||
labels2LineNumbers: HashMap<Label, String>
|
||||
): MethodVisitor {
|
||||
return object : MethodVisitor(Opcodes.API_VERSION) {
|
||||
private var lastLabel: Label? = null
|
||||
|
||||
override fun visitMethodInsn(opcode: Int, owner: String, name: String, desc: String, itf: Boolean) {
|
||||
if (LINE_NUMBER_FUN == name) {
|
||||
labels.add(lastLabel ?: error("A function call with no preceding label"))
|
||||
}
|
||||
lastLabel = null
|
||||
}
|
||||
|
||||
override fun visitLabel(label: Label) {
|
||||
lastLabel = label
|
||||
}
|
||||
|
||||
override fun visitLineNumber(line: Int, start: Label) {
|
||||
labels2LineNumbers[start] = line.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected open fun readAllLineNumbers(reader: ClassReader): List<String> {
|
||||
val result = ArrayList<String>()
|
||||
val visitedLabels = HashSet<String>()
|
||||
|
||||
reader.accept(object : ClassVisitor(Opcodes.API_VERSION) {
|
||||
override fun visitMethod(
|
||||
access: Int,
|
||||
name: String,
|
||||
desc: String,
|
||||
signature: String?,
|
||||
exceptions: Array<String>?
|
||||
): MethodVisitor {
|
||||
return object : MethodVisitor(Opcodes.API_VERSION) {
|
||||
override fun visitLineNumber(line: Int, label: Label) {
|
||||
val overrides = !visitedLabels.add(label.toString())
|
||||
|
||||
result.add((if (overrides) "+" else "") + line)
|
||||
}
|
||||
}
|
||||
}
|
||||
}, ClassReader.SKIP_FRAMES)
|
||||
return result
|
||||
}
|
||||
|
||||
protected open fun extractSelectedLineNumbersFromSource(file: KtFile): List<String> {
|
||||
val fileContent = file.text
|
||||
val lineNumbers = arrayListOf<String>()
|
||||
val lines = StringUtil.convertLineSeparators(fileContent).split("\n".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
|
||||
|
||||
for (i in lines.indices) {
|
||||
val matcher = TEST_LINE_NUMBER_PATTERN.matcher(lines[i])
|
||||
if (matcher.matches()) {
|
||||
lineNumbers.add((i + 1).toString())
|
||||
}
|
||||
}
|
||||
|
||||
return lineNumbers
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val LINE_NUMBER_FUN = "lineNumber"
|
||||
private val TEST_LINE_NUMBER_PATTERN = Pattern.compile("^.*test.$LINE_NUMBER_FUN\\(\\).*$")
|
||||
|
||||
private fun createLineNumberDeclaration() =
|
||||
TestFile(
|
||||
"$LINE_NUMBER_FUN.kt",
|
||||
"package test;\n\npublic fun $LINE_NUMBER_FUN(): Int = 0\n"
|
||||
)
|
||||
|
||||
private fun getActualLineNumbersAsString(lines: List<String>) =
|
||||
lines.joinToString(" ", "// ")
|
||||
}
|
||||
}
|
||||
+38
-33
@@ -9,6 +9,7 @@ import com.sun.jdi.VirtualMachine
|
||||
import com.sun.jdi.event.Event
|
||||
import com.sun.jdi.event.LocatableEvent
|
||||
import junit.framework.TestCase
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils.assertEqualsToFile
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
import org.junit.AfterClass
|
||||
import org.junit.BeforeClass
|
||||
@@ -51,38 +52,11 @@ abstract class AbstractSteppingTest : AbstractDebugTest() {
|
||||
loggedItems.add(event)
|
||||
}
|
||||
|
||||
data class SteppingExpectations(val forceStepInto: Boolean, val lineNumbers: String)
|
||||
|
||||
private fun readExpectations(wholeFile: File): SteppingExpectations {
|
||||
val expected = mutableListOf<String>()
|
||||
val lines = wholeFile.readLines().dropWhile {
|
||||
!it.startsWith(LINENUMBERS_MARKER) && !it.startsWith(FORCE_STEP_INTO_MARKER)
|
||||
}
|
||||
var forceStepInto = false
|
||||
var currentBackend = TargetBackend.ANY
|
||||
for (line in lines) {
|
||||
if (line.trim() == FORCE_STEP_INTO_MARKER) {
|
||||
forceStepInto = true
|
||||
continue
|
||||
}
|
||||
if (line.startsWith(LINENUMBERS_MARKER)) {
|
||||
currentBackend = when (line) {
|
||||
LINENUMBERS_MARKER -> TargetBackend.ANY
|
||||
JVM_LINENUMBER_MARKER -> TargetBackend.JVM
|
||||
JVM_IR_LINENUMBER_MARKER -> TargetBackend.JVM_IR
|
||||
else -> error("Expected JVM backend")
|
||||
}
|
||||
continue
|
||||
}
|
||||
if (currentBackend == TargetBackend.ANY || currentBackend == backend) {
|
||||
expected.add(line.drop(3).trim())
|
||||
}
|
||||
}
|
||||
return SteppingExpectations(forceStepInto, expected.joinToString("\n"))
|
||||
}
|
||||
|
||||
override fun checkResult(wholeFile: File, loggedItems: List<Any>) {
|
||||
val (forceStepInto, expectedLineNumbers) = readExpectations(wholeFile)
|
||||
val actual = mutableListOf<String>()
|
||||
val lines = wholeFile.readLines()
|
||||
val forceStepInto = lines.any { it.startsWith(FORCE_STEP_INTO_MARKER) }
|
||||
|
||||
val actualLineNumbers = loggedItems
|
||||
.filter {
|
||||
val location = (it as LocatableEvent).location()
|
||||
@@ -93,9 +67,40 @@ abstract class AbstractSteppingTest : AbstractDebugTest() {
|
||||
.map { event ->
|
||||
val location = (event as LocatableEvent).location()
|
||||
val synthetic = if (location.method().isSynthetic) " (synthetic)" else ""
|
||||
"${location.sourceName()}:${location.lineNumber()} ${location.method().name()}$synthetic"
|
||||
"// ${location.sourceName()}:${location.lineNumber()} ${location.method().name()}$synthetic"
|
||||
}
|
||||
TestCase.assertEquals(expectedLineNumbers, actualLineNumbers.joinToString("\n"))
|
||||
val actualLineNumbersIterator = actualLineNumbers.iterator()
|
||||
|
||||
val lineIterator = lines.iterator()
|
||||
for (line in lineIterator) {
|
||||
actual.add(line)
|
||||
if (line.startsWith(LINENUMBERS_MARKER) || line.startsWith(FORCE_STEP_INTO_MARKER)) break
|
||||
}
|
||||
|
||||
var currentBackend = TargetBackend.ANY
|
||||
for (line in lineIterator) {
|
||||
if (line.startsWith(LINENUMBERS_MARKER)) {
|
||||
actual.add(line)
|
||||
currentBackend = when (line) {
|
||||
LINENUMBERS_MARKER -> TargetBackend.ANY
|
||||
JVM_LINENUMBER_MARKER -> TargetBackend.JVM
|
||||
JVM_IR_LINENUMBER_MARKER -> TargetBackend.JVM_IR
|
||||
else -> error("Expected JVM backend")
|
||||
}
|
||||
continue
|
||||
}
|
||||
if (currentBackend == TargetBackend.ANY || currentBackend == backend) {
|
||||
if (actualLineNumbersIterator.hasNext()) {
|
||||
actual.add(actualLineNumbersIterator.next())
|
||||
}
|
||||
} else {
|
||||
actual.add(line)
|
||||
}
|
||||
}
|
||||
|
||||
actualLineNumbersIterator.forEach { actual.add(it) }
|
||||
|
||||
assertEqualsToFile(wholeFile, actual.joinToString("\n"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-77
@@ -1,77 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.codegen.ir
|
||||
|
||||
import org.jetbrains.kotlin.codegen.AbstractLineNumberTest
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.test.TargetBackend
|
||||
import org.jetbrains.kotlin.test.testFramework.KtUsefulTestCase
|
||||
import org.jetbrains.org.objectweb.asm.ClassReader
|
||||
import org.jetbrains.org.objectweb.asm.Label
|
||||
import org.jetbrains.org.objectweb.asm.MethodVisitor
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes
|
||||
import java.io.File
|
||||
|
||||
abstract class AbstractIrLineNumberTest : AbstractLineNumberTest() {
|
||||
override fun compareCustom(psiFile: KtFile, wholeFile: File) {
|
||||
val fileText = psiFile.text
|
||||
val expectedLineNumbers = normalize(
|
||||
fileText.substring(Regex("// \\d+").find(fileText)!!.range.start + 2)
|
||||
.trim().split(" ").map { it.trim() }.toMutableList()
|
||||
)
|
||||
val actualLineNumbers = normalize(extractActualLineNumbersFromBytecode(classFileFactory, false))
|
||||
KtUsefulTestCase.assertSameElements(actualLineNumbers, expectedLineNumbers)
|
||||
}
|
||||
|
||||
override fun readAllLineNumbers(reader: ClassReader) =
|
||||
normalize(super.readAllLineNumbers(reader))
|
||||
|
||||
override fun extractSelectedLineNumbersFromSource(file: KtFile) =
|
||||
normalize(super.extractSelectedLineNumbersFromSource(file))
|
||||
|
||||
override fun getTestFunLineNumbersMethodVisitor(
|
||||
labels: ArrayList<Label>,
|
||||
labels2LineNumbers: java.util.HashMap<Label, String>
|
||||
): MethodVisitor {
|
||||
return object : MethodVisitor(Opcodes.API_VERSION) {
|
||||
private var lastLabel: Label? = null
|
||||
private var lastLine = -1
|
||||
|
||||
override fun visitMethodInsn(opcode: Int, owner: String, name: String, desc: String, itf: Boolean) {
|
||||
if (LINE_NUMBER_FUN == name) {
|
||||
labels.add(lastLabel ?: error("A function call with no preceding label"))
|
||||
}
|
||||
}
|
||||
|
||||
override fun visitLabel(label: Label) {
|
||||
if (lastLabel != null && !labels2LineNumbers.containsKey(lastLabel!!) && lastLine >= 0) {
|
||||
labels2LineNumbers[lastLabel!!] = lastLine.toString() // Inherited line number
|
||||
}
|
||||
lastLabel = label
|
||||
}
|
||||
|
||||
override fun visitLineNumber(line: Int, start: Label) {
|
||||
labels2LineNumbers[start] = line.toString()
|
||||
lastLine = line
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun readTestFunLineNumbers(cr: ClassReader) =
|
||||
normalize(super.readTestFunLineNumbers(cr))
|
||||
|
||||
private fun normalize(numbers: List<String>) =
|
||||
numbers
|
||||
.map { if (it.startsWith('+')) it.substring(1) else it }
|
||||
.toSet()
|
||||
.toMutableList()
|
||||
.sortedBy { it.toInt() }
|
||||
.toList()
|
||||
|
||||
override fun getBackend(): TargetBackend {
|
||||
return TargetBackend.JVM_IR
|
||||
}
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.codegen;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("compiler/testData/lineNumber")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class LineNumberTestGenerated extends AbstractLineNumberTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInLineNumber() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/lineNumber"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/lineNumber/custom")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Custom extends AbstractLineNumberTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInCustom() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/lineNumber/custom"), Pattern.compile("^(.+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@TestMetadata("beforeGotoToWhileStart.kt")
|
||||
public void testBeforeGotoToWhileStart() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/beforeGotoToWhileStart.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("callWithCallInArguments.kt")
|
||||
public void testCallWithCallInArguments() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/callWithCallInArguments.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("callWithReceiver.kt")
|
||||
public void testCallWithReceiver() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/callWithReceiver.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("chainCall.kt")
|
||||
public void testChainCall() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/chainCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compileTimeConstant.kt")
|
||||
public void testCompileTimeConstant() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/compileTimeConstant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionCallWithDefault.kt")
|
||||
public void testFunctionCallWithDefault() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/functionCallWithDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionCallWithInlinedLambdaParam.kt")
|
||||
public void testFunctionCallWithInlinedLambdaParam() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/functionCallWithInlinedLambdaParam.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionCallWithLambdaParam.kt")
|
||||
public void testFunctionCallWithLambdaParam() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/functionCallWithLambdaParam.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ifThen.kt")
|
||||
public void testIfThen() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/ifThen.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ifThenElse.kt")
|
||||
public void testIfThenElse() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/ifThenElse.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ifThenElseFalse.kt")
|
||||
public void testIfThenElseFalse() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/ifThenElseFalse.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inTheEndOfLambdaArgumentOfInlineCall.kt")
|
||||
public void testInTheEndOfLambdaArgumentOfInlineCall() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/inTheEndOfLambdaArgumentOfInlineCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initBlocks.kt")
|
||||
public void testInitBlocks() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/initBlocks.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("multilineFunctionCall.kt")
|
||||
public void testMultilineFunctionCall() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/multilineFunctionCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("multilineInfixCall.kt")
|
||||
public void testMultilineInfixCall() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/multilineInfixCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noParametersArgumentCallInExpression.kt")
|
||||
public void testNoParametersArgumentCallInExpression() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/noParametersArgumentCallInExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primitiveNullChecks.kt")
|
||||
public void testPrimitiveNullChecks() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/primitiveNullChecks.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smapInlineAsArgument.kt")
|
||||
public void testSmapInlineAsArgument() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/smapInlineAsArgument.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smapInlineAsInfixArgument.kt")
|
||||
public void testSmapInlineAsInfixArgument() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/smapInlineAsInfixArgument.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smapInlineAsInlineArgument.kt")
|
||||
public void testSmapInlineAsInlineArgument() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/smapInlineAsInlineArgument.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smapInlineInIntrinsicArgument.kt")
|
||||
public void testSmapInlineInIntrinsicArgument() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/smapInlineInIntrinsicArgument.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatchExpression.kt")
|
||||
public void testTryCatchExpression() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/tryCatchExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatchFinally.kt")
|
||||
public void testTryCatchFinally() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/tryCatchFinally.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryFinally.kt")
|
||||
public void testTryFinally() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/tryFinally.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("when.kt")
|
||||
public void testWhen() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/when.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("whenSubject.kt")
|
||||
public void testWhenSubject() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/whenSubject.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
+156
@@ -43,12 +43,36 @@ public class IrSteppingTestGenerated extends AbstractIrSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/assertion.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("beforeGotoToWhileStart.kt")
|
||||
public void testBeforeGotoToWhileStart() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/beforeGotoToWhileStart.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("callWithCallInArguments.kt")
|
||||
public void testCallWithCallInArguments() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/callWithCallInArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("callWithReceiver.kt")
|
||||
public void testCallWithReceiver() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/callWithReceiver.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("callableReference.kt")
|
||||
public void testCallableReference() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/callableReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("chainCall.kt")
|
||||
public void testChainCall() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/chainCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("class.kt")
|
||||
public void testClass() throws Exception {
|
||||
@@ -61,6 +85,12 @@ public class IrSteppingTestGenerated extends AbstractIrSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/classObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("compileTimeConstant.kt")
|
||||
public void testCompileTimeConstant() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/compileTimeConstant.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("conjunction.kt")
|
||||
public void testConjunction() throws Exception {
|
||||
@@ -85,6 +115,24 @@ public class IrSteppingTestGenerated extends AbstractIrSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/for.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionCallWithDefault.kt")
|
||||
public void testFunctionCallWithDefault() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/functionCallWithDefault.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionCallWithInlinedLambdaParam.kt")
|
||||
public void testFunctionCallWithInlinedLambdaParam() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/functionCallWithInlinedLambdaParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionCallWithLambdaParam.kt")
|
||||
public void testFunctionCallWithLambdaParam() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/functionCallWithLambdaParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionInAnotherFile.kt")
|
||||
public void testFunctionInAnotherFile() throws Exception {
|
||||
@@ -103,6 +151,24 @@ public class IrSteppingTestGenerated extends AbstractIrSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/if2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ifThen.kt")
|
||||
public void testIfThen() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/ifThen.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ifThenElse.kt")
|
||||
public void testIfThenElse() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/ifThenElse.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ifThenElseFalse.kt")
|
||||
public void testIfThenElseFalse() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/ifThenElseFalse.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("IfTrueThenFalse.kt")
|
||||
public void testIfTrueThenFalse() throws Exception {
|
||||
@@ -115,6 +181,18 @@ public class IrSteppingTestGenerated extends AbstractIrSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/iincStepping.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inTheEndOfLambdaArgumentOfInlineCall.kt")
|
||||
public void testInTheEndOfLambdaArgumentOfInlineCall() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/inTheEndOfLambdaArgumentOfInlineCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initBlocks.kt")
|
||||
public void testInitBlocks() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/initBlocks.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineCallableReference.kt")
|
||||
public void testInlineCallableReference() throws Exception {
|
||||
@@ -157,6 +235,18 @@ public class IrSteppingTestGenerated extends AbstractIrSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/localFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("multilineFunctionCall.kt")
|
||||
public void testMultilineFunctionCall() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/multilineFunctionCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("multilineInfixCall.kt")
|
||||
public void testMultilineInfixCall() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/multilineInfixCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("namedCallableReference.kt")
|
||||
public void testNamedCallableReference() throws Exception {
|
||||
@@ -169,6 +259,18 @@ public class IrSteppingTestGenerated extends AbstractIrSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/nestedInline.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("noParametersArgumentCallInExpression.kt")
|
||||
public void testNoParametersArgumentCallInExpression() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/noParametersArgumentCallInExpression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitiveNullChecks.kt")
|
||||
public void testPrimitiveNullChecks() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/primitiveNullChecks.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyAccessor.kt")
|
||||
public void testPropertyAccessor() throws Exception {
|
||||
@@ -211,6 +313,30 @@ public class IrSteppingTestGenerated extends AbstractIrSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/simpleSmap.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("smapInlineAsArgument.kt")
|
||||
public void testSmapInlineAsArgument() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/smapInlineAsArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("smapInlineAsInfixArgument.kt")
|
||||
public void testSmapInlineAsInfixArgument() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/smapInlineAsInfixArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("smapInlineAsInlineArgument.kt")
|
||||
public void testSmapInlineAsInlineArgument() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/smapInlineAsInlineArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("smapInlineInIntrinsicArgument.kt")
|
||||
public void testSmapInlineInIntrinsicArgument() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/smapInlineInIntrinsicArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("throwException.kt")
|
||||
public void testThrowException() throws Exception {
|
||||
@@ -235,12 +361,42 @@ public class IrSteppingTestGenerated extends AbstractIrSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/tryCatch.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tryCatchExpression.kt")
|
||||
public void testTryCatchExpression() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/tryCatchExpression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tryCatchFinally.kt")
|
||||
public void testTryCatchFinally() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/tryCatchFinally.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tryFinally.kt")
|
||||
public void testTryFinally() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/tryFinally.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("voidLambdaStepInline.kt")
|
||||
public void testVoidLambdaStepInline() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/voidLambdaStepInline.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("when.kt")
|
||||
public void testWhen() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/when.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("whenSubject.kt")
|
||||
public void testWhenSubject() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/whenSubject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("while.kt")
|
||||
public void testWhile() throws Exception {
|
||||
|
||||
+156
@@ -43,12 +43,36 @@ public class SteppingTestGenerated extends AbstractSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/assertion.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("beforeGotoToWhileStart.kt")
|
||||
public void testBeforeGotoToWhileStart() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/beforeGotoToWhileStart.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("callWithCallInArguments.kt")
|
||||
public void testCallWithCallInArguments() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/callWithCallInArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("callWithReceiver.kt")
|
||||
public void testCallWithReceiver() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/callWithReceiver.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("callableReference.kt")
|
||||
public void testCallableReference() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/callableReference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("chainCall.kt")
|
||||
public void testChainCall() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/chainCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("class.kt")
|
||||
public void testClass() throws Exception {
|
||||
@@ -61,6 +85,12 @@ public class SteppingTestGenerated extends AbstractSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/classObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("compileTimeConstant.kt")
|
||||
public void testCompileTimeConstant() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/compileTimeConstant.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("conjunction.kt")
|
||||
public void testConjunction() throws Exception {
|
||||
@@ -85,6 +115,24 @@ public class SteppingTestGenerated extends AbstractSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/for.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionCallWithDefault.kt")
|
||||
public void testFunctionCallWithDefault() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/functionCallWithDefault.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionCallWithInlinedLambdaParam.kt")
|
||||
public void testFunctionCallWithInlinedLambdaParam() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/functionCallWithInlinedLambdaParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionCallWithLambdaParam.kt")
|
||||
public void testFunctionCallWithLambdaParam() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/functionCallWithLambdaParam.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("functionInAnotherFile.kt")
|
||||
public void testFunctionInAnotherFile() throws Exception {
|
||||
@@ -103,6 +151,24 @@ public class SteppingTestGenerated extends AbstractSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/if2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ifThen.kt")
|
||||
public void testIfThen() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/ifThen.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ifThenElse.kt")
|
||||
public void testIfThenElse() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/ifThenElse.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ifThenElseFalse.kt")
|
||||
public void testIfThenElseFalse() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/ifThenElseFalse.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("IfTrueThenFalse.kt")
|
||||
public void testIfTrueThenFalse() throws Exception {
|
||||
@@ -115,6 +181,18 @@ public class SteppingTestGenerated extends AbstractSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/iincStepping.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inTheEndOfLambdaArgumentOfInlineCall.kt")
|
||||
public void testInTheEndOfLambdaArgumentOfInlineCall() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/inTheEndOfLambdaArgumentOfInlineCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("initBlocks.kt")
|
||||
public void testInitBlocks() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/initBlocks.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("inlineCallableReference.kt")
|
||||
public void testInlineCallableReference() throws Exception {
|
||||
@@ -157,6 +235,18 @@ public class SteppingTestGenerated extends AbstractSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/localFunction.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("multilineFunctionCall.kt")
|
||||
public void testMultilineFunctionCall() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/multilineFunctionCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("multilineInfixCall.kt")
|
||||
public void testMultilineInfixCall() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/multilineInfixCall.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("namedCallableReference.kt")
|
||||
public void testNamedCallableReference() throws Exception {
|
||||
@@ -169,6 +259,18 @@ public class SteppingTestGenerated extends AbstractSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/nestedInline.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("noParametersArgumentCallInExpression.kt")
|
||||
public void testNoParametersArgumentCallInExpression() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/noParametersArgumentCallInExpression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("primitiveNullChecks.kt")
|
||||
public void testPrimitiveNullChecks() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/primitiveNullChecks.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyAccessor.kt")
|
||||
public void testPropertyAccessor() throws Exception {
|
||||
@@ -211,6 +313,30 @@ public class SteppingTestGenerated extends AbstractSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/simpleSmap.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("smapInlineAsArgument.kt")
|
||||
public void testSmapInlineAsArgument() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/smapInlineAsArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("smapInlineAsInfixArgument.kt")
|
||||
public void testSmapInlineAsInfixArgument() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/smapInlineAsInfixArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("smapInlineAsInlineArgument.kt")
|
||||
public void testSmapInlineAsInlineArgument() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/smapInlineAsInlineArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("smapInlineInIntrinsicArgument.kt")
|
||||
public void testSmapInlineInIntrinsicArgument() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/smapInlineInIntrinsicArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("throwException.kt")
|
||||
public void testThrowException() throws Exception {
|
||||
@@ -235,12 +361,42 @@ public class SteppingTestGenerated extends AbstractSteppingTest {
|
||||
runTest("compiler/testData/debug/stepping/tryCatch.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tryCatchExpression.kt")
|
||||
public void testTryCatchExpression() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/tryCatchExpression.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tryCatchFinally.kt")
|
||||
public void testTryCatchFinally() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/tryCatchFinally.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("tryFinally.kt")
|
||||
public void testTryFinally() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/tryFinally.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("voidLambdaStepInline.kt")
|
||||
public void testVoidLambdaStepInline() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/voidLambdaStepInline.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("when.kt")
|
||||
public void testWhen() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/when.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("whenSubject.kt")
|
||||
public void testWhenSubject() throws Exception {
|
||||
runTest("compiler/testData/debug/stepping/whenSubject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("while.kt")
|
||||
public void testWhile() throws Exception {
|
||||
|
||||
-174
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.codegen.ir;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.kotlin.test.KotlinTestUtils;
|
||||
import org.jetbrains.kotlin.test.TargetBackend;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("compiler/testData/lineNumber")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public class IrLineNumberTestGenerated extends AbstractIrLineNumberTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInLineNumber() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/lineNumber"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/lineNumber/custom")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Custom extends AbstractIrLineNumberTest {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInCustom() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/lineNumber/custom"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||
}
|
||||
|
||||
@TestMetadata("beforeGotoToWhileStart.kt")
|
||||
public void testBeforeGotoToWhileStart() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/beforeGotoToWhileStart.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("callWithCallInArguments.kt")
|
||||
public void testCallWithCallInArguments() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/callWithCallInArguments.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("callWithReceiver.kt")
|
||||
public void testCallWithReceiver() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/callWithReceiver.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("chainCall.kt")
|
||||
public void testChainCall() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/chainCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compileTimeConstant.kt")
|
||||
public void testCompileTimeConstant() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/compileTimeConstant.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionCallWithDefault.kt")
|
||||
public void testFunctionCallWithDefault() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/functionCallWithDefault.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionCallWithInlinedLambdaParam.kt")
|
||||
public void testFunctionCallWithInlinedLambdaParam() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/functionCallWithInlinedLambdaParam.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionCallWithLambdaParam.kt")
|
||||
public void testFunctionCallWithLambdaParam() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/functionCallWithLambdaParam.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ifThen.kt")
|
||||
public void testIfThen() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/ifThen.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ifThenElse.kt")
|
||||
public void testIfThenElse() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/ifThenElse.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ifThenElseFalse.kt")
|
||||
public void testIfThenElseFalse() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/ifThenElseFalse.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inTheEndOfLambdaArgumentOfInlineCall.kt")
|
||||
public void testInTheEndOfLambdaArgumentOfInlineCall() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/inTheEndOfLambdaArgumentOfInlineCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("initBlocks.kt")
|
||||
public void testInitBlocks() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/initBlocks.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("multilineFunctionCall.kt")
|
||||
public void testMultilineFunctionCall() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/multilineFunctionCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("multilineInfixCall.kt")
|
||||
public void testMultilineInfixCall() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/multilineInfixCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("noParametersArgumentCallInExpression.kt")
|
||||
public void testNoParametersArgumentCallInExpression() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/noParametersArgumentCallInExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("primitiveNullChecks.kt")
|
||||
public void testPrimitiveNullChecks() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/primitiveNullChecks.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smapInlineAsArgument.kt")
|
||||
public void testSmapInlineAsArgument() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/smapInlineAsArgument.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smapInlineAsInfixArgument.kt")
|
||||
public void testSmapInlineAsInfixArgument() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/smapInlineAsInfixArgument.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smapInlineAsInlineArgument.kt")
|
||||
public void testSmapInlineAsInlineArgument() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/smapInlineAsInlineArgument.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("smapInlineInIntrinsicArgument.kt")
|
||||
public void testSmapInlineInIntrinsicArgument() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/smapInlineInIntrinsicArgument.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatchExpression.kt")
|
||||
public void testTryCatchExpression() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/tryCatchExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryCatchFinally.kt")
|
||||
public void testTryCatchFinally() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/tryCatchFinally.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryFinally.kt")
|
||||
public void testTryFinally() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/tryFinally.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("when.kt")
|
||||
public void testWhen() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/when.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("whenSubject.kt")
|
||||
public void testWhenSubject() throws Exception {
|
||||
runTest("compiler/testData/lineNumber/custom/whenSubject.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -391,10 +391,6 @@ fun main() {
|
||||
model("type/binding")
|
||||
}
|
||||
|
||||
testClass<AbstractLineNumberTest> {
|
||||
model("lineNumber")
|
||||
}
|
||||
|
||||
testClass<AbstractSteppingTest>(useJunit4 = true) {
|
||||
model("debug/stepping", targetBackend = TargetBackend.JVM)
|
||||
}
|
||||
@@ -485,10 +481,6 @@ fun main() {
|
||||
model("loadJava/sourceJava", extension = "java", testMethod = "doTestSourceJava", targetBackend = TargetBackend.JVM_IR)
|
||||
}
|
||||
|
||||
testClass<AbstractIrLineNumberTest> {
|
||||
model("lineNumber", targetBackend = TargetBackend.JVM_IR)
|
||||
}
|
||||
|
||||
testClass<AbstractIrSteppingTest>(useJunit4 = true) {
|
||||
model("debug/stepping", targetBackend = TargetBackend.JVM_IR)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user