[JS IR] Make tests that use directives pass with IR BE
This commit is contained in:
Vendored
+2
-1
@@ -2,7 +2,8 @@
|
||||
// WITH_COROUTINES
|
||||
// CHECK_BYTECODE_LISTING
|
||||
// CHECK_NEW_COUNT: function=suspendHere count=0
|
||||
// CHECK_NEW_COUNT: function=complexSuspend count=0
|
||||
// FIXME: Coroutine inlining
|
||||
// CHECK_NEW_COUNT: function=complexSuspend count=0 TARGET_BACKENDS=JS
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
// CHECK_CASES_COUNT: function=bar1 count=6
|
||||
// CHECK_IF_COUNT: function=bar1 count=0
|
||||
// CHECK_CASES_COUNT: function=bar2 count=6
|
||||
// CHECK_IF_COUNT: function=bar2 count=0
|
||||
// CHECK_CASES_COUNT: function=bar1 count=6 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=bar1 count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar1 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar1 count=2 IGNORED_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=bar2 count=6 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=bar2 count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar2 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar2 count=3 IGNORED_BACKENDS=JS
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
// CHECK_CASES_COUNT: function=bar count=3
|
||||
// CHECK_IF_COUNT: function=bar count=0
|
||||
// CHECK_CASES_COUNT: function=bar count=3 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=bar count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar count=2 IGNORED_BACKENDS=JS
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// CHECK_CASES_COUNT: function=foo count=3
|
||||
// CHECK_CASES_COUNT: function=foo count=3 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=foo count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=foo count=0
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
// WITH_RUNTIME
|
||||
// CHECK_CASES_COUNT: function=bar1 count=3
|
||||
// CHECK_CASES_COUNT: function=bar1 count=3 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=bar1 count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar1 count=0
|
||||
// CHECK_CASES_COUNT: function=bar2 count=4
|
||||
// CHECK_IF_COUNT: function=bar2 count=0
|
||||
// CHECK_CASES_COUNT: function=bar2 count=4 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=bar2 count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar2 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar2 count=3 IGNORED_BACKENDS=JS
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
// CHECK_CASES_COUNT: function=box$lambda count=0
|
||||
// CHECK_IF_COUNT: function=box$lambda count=1
|
||||
// CHECK_IF_COUNT: function=box$lambda count=1 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=box$lambda count=0 IGNORED_BACKENDS=JS
|
||||
|
||||
enum class Season {
|
||||
WINTER,
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// CHECK_CASES_COUNT: function=box count=6
|
||||
// CHECK_IF_COUNT: function=box count=1
|
||||
// CHECK_CASES_COUNT: function=box count=6 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=box count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=box count=1 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=box count=7 IGNORED_BACKENDS=JS
|
||||
|
||||
enum class En { A, B, C }
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// CHECK_CASES_COUNT: function=box count=18
|
||||
// CHECK_IF_COUNT: function=box count=3
|
||||
// CHECK_CASES_COUNT: function=box count=18 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=box count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=box count=3 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=box count=21 IGNORED_BACKENDS=JS
|
||||
|
||||
enum class En { A, B, C }
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// CHECK_CASES_COUNT: function=crash count=2
|
||||
// CHECK_IF_COUNT: function=crash count=1
|
||||
// CHECK_CASES_COUNT: function=crash count=2 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=crash count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=crash count=1 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=crash count=3 IGNORED_BACKENDS=JS
|
||||
|
||||
class EncapsulatedEnum<T : Enum<T>>(val value: T)
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
// CHECK_CASES_COUNT: function=doTheThing count=2
|
||||
// CHECK_IF_COUNT: function=doTheThing count=2
|
||||
// CHECK_CASES_COUNT: function=doTheThing count=2 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=doTheThing count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=doTheThing count=2 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=doTheThing count=4 IGNORED_BACKENDS=JS
|
||||
|
||||
private fun Any?.doTheThing(): String {
|
||||
when (this) {
|
||||
|
||||
+6
-3
@@ -1,7 +1,10 @@
|
||||
// WITH_RUNTIME
|
||||
// CHECK_CASES_COUNT: function=bar1_u51tkt$ count=3
|
||||
// CHECK_IF_COUNT: function=bar1_u51tkt$ count=0
|
||||
// CHECK_CASES_COUNT: function=A$bar2$lambda count=3
|
||||
// CHECK_CASES_COUNT: function=bar1_u51tkt$ count=3 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=bar1_eni42q_k$ count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar1_u51tkt$ count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar1_eni42q_k$ count=3 IGNORED_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=A$bar2$lambda count=3 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=A$bar2$lambda count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=A$bar2$lambda count=0
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
// CHECK_CASES_COUNT: function=foo count=0
|
||||
// CHECK_IF_COUNT: function=foo count=3
|
||||
// CHECK_IF_COUNT: function=foo count=3 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=foo count=0 IGNORED_BACKENDS=JS
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
// WITH_RUNTIME
|
||||
// CHECK_CASES_COUNT: function=bar1 count=3
|
||||
// CHECK_IF_COUNT: function=bar1 count=0
|
||||
// CHECK_CASES_COUNT: function=bar2 count=4
|
||||
// CHECK_IF_COUNT: function=bar2 count=0
|
||||
// CHECK_CASES_COUNT: function=bar1 count=3 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=bar1 count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar1 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar1 count=3 IGNORED_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=bar2 count=4 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=bar2 count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar2 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=bar2 count=4 IGNORED_BACKENDS=JS
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// CHECK_CASES_COUNT: function=foo count=3
|
||||
// CHECK_CASES_COUNT: function=foo count=3 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=foo count=4 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=foo count=0
|
||||
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
// CHECK_CASES_COUNT: function=foo1 count=2
|
||||
// CHECK_IF_COUNT: function=foo1 count=1
|
||||
// CHECK_CASES_COUNT: function=foo1 count=2 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=foo1 count=5 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=foo1 count=1 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=foo1 count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=foo2 count=4
|
||||
// CHECK_IF_COUNT: function=foo2 count=0
|
||||
|
||||
|
||||
+10
-5
@@ -1,9 +1,14 @@
|
||||
// CHECK_CASES_COUNT: function=test1 count=2
|
||||
// CHECK_IF_COUNT: function=test1 count=0
|
||||
// CHECK_BREAKS_COUNT: function=test1 count=1
|
||||
// CHECK_CASES_COUNT: function=test1 count=2 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=test1 count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=test1 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=test1 count=1 IGNORED_BACKENDS=JS
|
||||
// CHECK_BREAKS_COUNT: function=test1 count=1 TARGET_BACKENDS=JS
|
||||
// CHECK_BREAKS_COUNT: function=test1 count=0 IGNORED_BACKENDS=JS
|
||||
|
||||
// CHECK_CASES_COUNT: function=test2 count=2
|
||||
// CHECK_IF_COUNT: function=test2 count=0
|
||||
// CHECK_CASES_COUNT: function=test2 count=2 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=test2 count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=test2 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=test2 count=1 IGNORED_BACKENDS=JS
|
||||
// CHECK_BREAKS_COUNT: function=test2 count=1
|
||||
|
||||
fun test1(v: Int) {
|
||||
|
||||
@@ -2,11 +2,14 @@
|
||||
// WITH_RUNTIME
|
||||
// CHECK_CASES_COUNT: function=intFoo count=3
|
||||
// CHECK_IF_COUNT: function=intFoo count=0
|
||||
// CHECK_CASES_COUNT: function=shortFoo count=3
|
||||
// CHECK_CASES_COUNT: function=shortFoo count=3 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=shortFoo count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=shortFoo count=0
|
||||
// CHECK_CASES_COUNT: function=byteFoo count=3
|
||||
// CHECK_CASES_COUNT: function=byteFoo count=3 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=byteFoo count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=byteFoo count=0
|
||||
// CHECK_CASES_COUNT: function=charFoo count=3
|
||||
// CHECK_CASES_COUNT: function=charFoo count=3 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=charFoo count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=charFoo count=0
|
||||
|
||||
fun intFoo(x: Int): Int {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// WITH_RUNTIME
|
||||
// CHECK_CASES_COUNT: function=foo count=4
|
||||
// CHECK_IF_COUNT: function=foo count=1
|
||||
// CHECK_CASES_COUNT: function=foo count=4 TARGET_BACKENDS=JS
|
||||
// CHECK_CASES_COUNT: function=foo count=0 IGNORED_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=foo count=1 TARGET_BACKENDS=JS
|
||||
// CHECK_IF_COUNT: function=foo count=0 IGNORED_BACKENDS=JS
|
||||
|
||||
var log = ""
|
||||
|
||||
|
||||
Vendored
+2
-1
@@ -8,7 +8,8 @@ inline fun inlineFun(crossinline inlineLambda: () -> String = { "OK" }, noinline
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda_0 scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda_0 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=box$lambda scope=box IGNORED_BACKENDS=JS
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
|
||||
Vendored
+2
-1
@@ -1,6 +1,7 @@
|
||||
// SKIP_INLINE_CHECK_IN: inlineFun$default
|
||||
// FILE: 1.kt
|
||||
// CHECK_CONTAINS_NO_CALLS: test
|
||||
// CHECK_CONTAINS_NO_CALLS: test TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: test_0_k$ except=_get_value__0_k$ IGNORED_BACKENDS=JS
|
||||
package test
|
||||
|
||||
//problem in test framework
|
||||
|
||||
+2
-1
@@ -9,7 +9,8 @@ inline fun inlineFun(capturedParam: String, noinline lambda: () -> String = { ca
|
||||
fun call(lambda: () -> String ) = lambda()
|
||||
|
||||
// FILE: 2.kt
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=box$lambda scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=call scope=box
|
||||
import test.*
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@ inline fun inlineFun(crossinline inlineLambda: () -> String, noinline noInlineLa
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=inlineFun
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=inlineFun TARGET_BACKENDS=JS
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@ inline fun String.inlineFun(crossinline lambda: () -> String = { this }): String
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda_0 scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda_0 scope=box TARGET_BACKENDS=JS
|
||||
|
||||
import test.*
|
||||
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@ inline fun String.inlineFun(crossinline lambda: () -> String, crossinline dlambd
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda_0 scope=test
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=test
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda_0 scope=test TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=test TARGET_BACKENDS=JS
|
||||
import test.*
|
||||
|
||||
fun String.test(): String = "INLINE".inlineFun({ this })
|
||||
|
||||
+2
-2
@@ -13,8 +13,8 @@ class A(val value: String) {
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda_0 scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda_0 scope=box TARGET_BACKENDS=JS
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+2
-2
@@ -13,8 +13,8 @@ class A(val value: String) {
|
||||
|
||||
// FILE: 2.kt
|
||||
//WIH_RUNTIME
|
||||
// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda scope=test
|
||||
// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda_0 scope=test
|
||||
// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda scope=test TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda_0 scope=test TARGET_BACKENDS=JS
|
||||
import test.*
|
||||
|
||||
fun String.test(): String = with(A("VALUE")) { "INLINE".inlineFun({ this@test }) }
|
||||
|
||||
+2
-1
@@ -7,7 +7,8 @@ inline fun inlineFun(capturedParam: String, lambda: () -> Any = { capturedParam
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=throwCCE;isType
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=throwCCE;isType TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=THROW_CCE;isObject IGNORED_BACKENDS=JS
|
||||
|
||||
import test.*
|
||||
|
||||
|
||||
Vendored
+2
-1
@@ -7,7 +7,8 @@ inline fun inlineFun(lambda: () -> Any = { "OK" as Any }): Any {
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=throwCCE;isType
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=throwCCE;isType TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=THROW_CCE;isObject IGNORED_BACKENDS=JS
|
||||
|
||||
import test.*
|
||||
|
||||
|
||||
+2
-1
@@ -11,7 +11,8 @@ inline fun <T : A> inlineFun(capturedParam: T, lambda: () -> T = { capturedParam
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
// CHECK_CONTAINS_NO_CALLS: box
|
||||
// CHECK_CONTAINS_NO_CALLS: box TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=_get_value__0_k$ IGNORED_BACKENDS=JS
|
||||
|
||||
import test.*
|
||||
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@ inline fun String.inlineFun(crossinline lambda: () -> String = { { this }() }):
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda_0 scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=inlineFun$lambda_0 scope=box TARGET_BACKENDS=JS
|
||||
|
||||
import test.*
|
||||
|
||||
|
||||
+2
-2
@@ -14,8 +14,8 @@ class A(val value: String) {
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda_0 scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=A$inlineFun$lambda_0 scope=box TARGET_BACKENDS=JS
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// EXPECTED_REACHABLE_NODES: 1292
|
||||
// CHECK_DEBUGGER_COUNT: function=doResume count=1
|
||||
// CHECK_DEBUGGER_COUNT: function=doResume count=1 TARGET_BACKENDS=JS
|
||||
// CHECK_DEBUGGER_COUNT: function=doResume_0_k$ count=1 IGNORED_BACKENDS=JS
|
||||
|
||||
fun foo(f: suspend () -> Unit) {
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1401
|
||||
// DECLARES_VARIABLE: function=doResume name=k
|
||||
// PROPERTY_READ_COUNT: name=local$o count=1
|
||||
// PROPERTY_WRITE_COUNT: name=local$o count=2
|
||||
|
||||
// Unmute when JS_IR supports release coroutines
|
||||
// DECLARES_VARIABLE: function=doResume name=k TARGET_BACKENDS=JS
|
||||
// DECLARES_VARIABLE: function=doResume_0_k$ name=k IGNORED_BACKENDS=JS
|
||||
// PROPERTY_READ_COUNT: name=local$o count=1 TARGET_BACKENDS=JS
|
||||
// PROPERTY_READ_COUNT: name=_o0 count=1 IGNORED_BACKENDS=JS
|
||||
// PROPERTY_WRITE_COUNT: name=local$o count=2 TARGET_BACKENDS=JS
|
||||
// PROPERTY_WRITE_COUNT: name=_o0 count=1 IGNORED_BACKENDS=JS
|
||||
|
||||
import kotlin.coroutines.*
|
||||
|
||||
|
||||
Vendored
+2
-1
@@ -1,5 +1,6 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1285
|
||||
// HAS_NO_CAPTURED_VARS: function=A_init except=Kotlin;A;equals
|
||||
// HAS_NO_CAPTURED_VARS: function=A_init except=Kotlin;A;equals TARGET_BACKENDS=JS
|
||||
// TODO: Enable this when KT-***** is resolved. // HAS_NO_CAPTURED_VARS: function=A_init_$Init$ except=A;equals IGNORED_BACKENDS=JS
|
||||
|
||||
class A() {
|
||||
var y: String? = null
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// EXPECTED_REACHABLE_NODES: 1283
|
||||
// CHECK_VARS_COUNT: function=test count=2
|
||||
// CHECK_VARS_COUNT: function=test count=2 TARGET_BACKENDS=JS
|
||||
// CHECK_VARS_COUNT: function=test_1 count=4 IGNORED_BACKENDS=JS
|
||||
var log = ""
|
||||
|
||||
fun test() {
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=component1 scope=test1
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=component1 scope=test2
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=component1 scope=test3
|
||||
// CHECK_CONTAINS_NO_CALLS: test4 except=toString
|
||||
// CHECK_CONTAINS_NO_CALLS: test4 except=toString TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: test4 except=_get_size__0_k$ IGNORED_BACKENDS=JS
|
||||
|
||||
fun test1(a: Sequence<String>): String {
|
||||
var s = ""
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
// CHECK_CONTAINS_NO_CALLS: testRangeToFunction
|
||||
// CHECK_CONTAINS_NO_CALLS: testUntil
|
||||
// CHECK_CONTAINS_NO_CALLS: testDownTo
|
||||
// CHECK_CONTAINS_NO_CALLS: testStep
|
||||
// CHECK_CONTAINS_NO_CALLS: testStep TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: testEmptyRange
|
||||
// CHECK_CONTAINS_NO_CALLS: testRangeToParams except=from;to
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1281
|
||||
// PROPERTY_WRITE_COUNT: name=foo_61zpoe$ count=1
|
||||
// PROPERTY_WRITE_COUNT: name=foo_61zpoe$ count=1 TARGET_BACKENDS=JS
|
||||
// FILE: a.kt
|
||||
fun foo(x: String): String = x
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1281
|
||||
package foo
|
||||
|
||||
// CHECK_FUNCTIONS_HAVE_SAME_LINES: syntaxTestInline syntaxTest
|
||||
// CHECK_FUNCTIONS_HAVE_SAME_LINES: syntaxTestInline syntaxTest TARGET_BACKENDS=JS
|
||||
|
||||
inline fun syntaxTestInline() {
|
||||
var result: Int = -0
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1288
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=equals;Baz_getInstance;callLocal;callLocalExtension
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=equals;Baz_getInstance;callLocal;callLocalExtension TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=Foo_getInstance;Bar;Baz_getInstance;callLocal;callLocalExtension IGNORED_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: callLocal
|
||||
// CHECK_CONTAINS_NO_CALLS: callLocalExtension
|
||||
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1284
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: multiplyInline except=imul
|
||||
// CHECK_CONTAINS_NO_CALLS: multiplyInline except=imul TARGET_BACKENDS=JS
|
||||
|
||||
// FIXME: Not inlined on IR BE
|
||||
// CHECK_CONTAINS_NO_CALLS: multiplyInline except=multiply_0 IGNORED_BACKENDS=JS
|
||||
|
||||
// CHECK_FUNCTION_EXISTS: runNoinline
|
||||
// CHECK_NOT_CALLED: runNoinline
|
||||
|
||||
internal inline fun multiply(a: Int, b: Int) = a * b
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1283
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: test
|
||||
// CHECK_CONTAINS_NO_CALLS: test except=Unit_getInstance
|
||||
|
||||
// A copy of stdlib run function.
|
||||
// Copied to not to depend on run implementation.
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1285
|
||||
package foo
|
||||
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: scope=multiply function=multiply$lambda
|
||||
// CHECK_CONTAINS_NO_CALLS: myMultiply except=A;imul
|
||||
|
||||
internal class A(val a: Int)
|
||||
|
||||
internal inline fun <T, R> with2(receiver: T, arg1: R, arg2: R, f: T.(R, R) -> R): R = receiver.f(arg1, arg2)
|
||||
|
||||
internal fun multiply(a: Int, b: Int, c: Int): Int = with2(A(a), b, c) { x, y -> a*x*y }
|
||||
internal fun myMultiply(a: Int, b: Int, c: Int): Int = with2(A(a), b, c) { x, y -> a*x*y }
|
||||
|
||||
fun box(): String {
|
||||
assertEquals(105, multiply(3, 5, 7))
|
||||
assertEquals(105, myMultiply(3, 5, 7))
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1286
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: test
|
||||
// CHECK_CONTAINS_NO_CALLS: test TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: test_0_k$ except=Unit_getInstance IGNORED_BACKENDS=JS
|
||||
|
||||
inline fun block(p: () -> Unit) = p()
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1292
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: maxBySquare except=imul
|
||||
// CHECK_CONTAINS_NO_CALLS: maxBySquare except=imul;Unit_getInstance
|
||||
|
||||
internal data class Result(var value: Int = 0, var invocationCount: Int = 0)
|
||||
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1296
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: add
|
||||
// CHECK_CONTAINS_NO_CALLS: myAdd
|
||||
|
||||
internal data class IntPair(public var fst: Int, public var snd: Int) {
|
||||
inline public fun getFst(): Int { return fst }
|
||||
@@ -11,7 +11,7 @@ internal data class IntPair(public var fst: Int, public var snd: Int) {
|
||||
inline public fun setSnd(v: Int) { this.snd = v }
|
||||
}
|
||||
|
||||
internal fun add(p: IntPair, toFst: Int, toSnd: Int) {
|
||||
internal fun myAdd(p: IntPair, toFst: Int, toSnd: Int) {
|
||||
val fst = p.getFst()
|
||||
p.setFst(fst + toFst)
|
||||
|
||||
@@ -21,7 +21,7 @@ internal fun add(p: IntPair, toFst: Int, toSnd: Int) {
|
||||
|
||||
fun box(): String {
|
||||
val p = IntPair(0, 0)
|
||||
add(p, 1, 2)
|
||||
myAdd(p, 1, 2)
|
||||
assertEquals(IntPair(1, 2), p)
|
||||
|
||||
return "OK"
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1286
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: factAbsNoInline1 except=imul
|
||||
// CHECK_CONTAINS_NO_CALLS: factAbsNoInline1 except=imul;Unit_getInstance
|
||||
|
||||
internal class State(value: Int) {
|
||||
public var value: Int = value
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1284
|
||||
package foo
|
||||
|
||||
// CHECK_FUNCTIONS_HAVE_SAME_LINES: declaredBefore declaredAfter match=(h|g)1 replace=$1
|
||||
// CHECK_FUNCTIONS_HAVE_SAME_LINES: declaredBefore declaredAfter match=(h|g)1 replace=$1 TARGET_BACKENDS=JS
|
||||
|
||||
fun declaredBefore(): Int {
|
||||
val a = g() + h()
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1375
|
||||
// CHECK_CONTAINS_NO_CALLS: testDispatch
|
||||
// CHECK_CONTAINS_NO_CALLS: testExtension
|
||||
// CHECK_CONTAINS_NO_CALLS: testDispatch except=Unit_getInstance
|
||||
// CHECK_CONTAINS_NO_CALLS: testExtension except=Unit_getInstance
|
||||
class Bar {
|
||||
inline operator fun invoke(f: () -> String) { f() }
|
||||
}
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1283
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: test
|
||||
// In the IR backend the injected JS code is outlined.
|
||||
// CHECK_CONTAINS_NO_CALLS: test TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=sum scope=test
|
||||
|
||||
internal inline fun sum(x: Int, y: Int): Int = js("x + y")
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1283
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: test
|
||||
// In the IR backend the injected JS code is outlined.
|
||||
// CHECK_CONTAINS_NO_CALLS: test TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=sum scope=test
|
||||
|
||||
internal inline fun sum(x: Int, y: Int): Int = js("var a = x; a + y")
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1292
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: capturedInLambda
|
||||
// CHECK_CONTAINS_NO_CALLS: declaredInLambda
|
||||
// CHECK_CONTAINS_NO_CALLS: capturedInLambda except=Unit_getInstance
|
||||
// CHECK_CONTAINS_NO_CALLS: declaredInLambda except=Unit_getInstance
|
||||
|
||||
internal data class State(var count: Int = 0)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1284
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: localWithCapture
|
||||
// CHECK_CONTAINS_NO_CALLS: localWithCapture except=Unit_getInstance
|
||||
// CHECK_CONTAINS_NO_CALLS: localWithoutCapture
|
||||
|
||||
internal inline fun repeatAction(times: Int, action: () -> Unit) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1291
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: add
|
||||
// CHECK_CONTAINS_NO_CALLS: addToState
|
||||
|
||||
internal data class State(var count: Int = 0)
|
||||
|
||||
@@ -11,7 +11,7 @@ internal inline fun repeatAction(times: Int, action: () -> Unit) {
|
||||
}
|
||||
}
|
||||
|
||||
internal fun add(state: State, a: Int, b: Int): Int {
|
||||
internal fun addToState(state: State, a: Int, b: Int): Int {
|
||||
inline fun inc(a: Int): Int {
|
||||
return a + 1
|
||||
}
|
||||
@@ -38,7 +38,7 @@ internal fun add(state: State, a: Int, b: Int): Int {
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
assertEquals(20, add(State(), 4, 5))
|
||||
assertEquals(20, addToState(State(), 4, 5))
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1284
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: localWithCapture
|
||||
// CHECK_CONTAINS_NO_CALLS: localWithCapture except=Unit_getInstance
|
||||
// CHECK_CONTAINS_NO_CALLS: localWithoutCapture
|
||||
|
||||
internal inline fun repeatAction(times: Int, action: () -> Unit) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1283
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: add
|
||||
// CHECK_CONTAINS_NO_CALLS: myAdd
|
||||
|
||||
internal inline fun run(action: () -> Int): Int {
|
||||
return action()
|
||||
}
|
||||
|
||||
internal fun add(a: Int, b: Int): Int {
|
||||
internal fun myAdd(a: Int, b: Int): Int {
|
||||
var sum = a + b
|
||||
|
||||
inline fun getSum(): Int {
|
||||
@@ -25,7 +25,7 @@ internal fun add(a: Int, b: Int): Int {
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
assertEquals(3, add(1, 2))
|
||||
assertEquals(3, myAdd(1, 2))
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -4,13 +4,14 @@ package foo
|
||||
// CHECK_CONTAINS_NO_CALLS: test1 except=imul
|
||||
// CHECK_CONTAINS_NO_CALLS: test2 except=imul
|
||||
// CHECK_CONTAINS_NO_CALLS: test3 except=imul
|
||||
// CHECK_CONTAINS_NO_CALLS: test4_buocd8$ except=imul
|
||||
// CHECK_CONTAINS_NO_CALLS: test5 except=imul
|
||||
// CHECK_HAS_INLINE_METADATA: apply
|
||||
// CHECK_HAS_INLINE_METADATA: applyL_h43q6c$
|
||||
// CHECK_HAS_INLINE_METADATA: applyM_h43q6c$
|
||||
// CHECK_HAS_INLINE_METADATA: applyN_h43q6c$
|
||||
// CHECK_HAS_NO_INLINE_METADATA: applyO_h43q6c$
|
||||
// CHECK_CONTAINS_NO_CALLS: test4_buocd8$ except=imul TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: test4_o4gm63_k$ except=imul IGNORED_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: test5 except=imul;OInner_getInstance
|
||||
// CHECK_HAS_INLINE_METADATA: apply TARGET_BACKENDS=JS
|
||||
// CHECK_HAS_INLINE_METADATA: applyL_h43q6c$ TARGET_BACKENDS=JS
|
||||
// CHECK_HAS_INLINE_METADATA: applyM_h43q6c$ TARGET_BACKENDS=JS
|
||||
// CHECK_HAS_INLINE_METADATA: applyN_h43q6c$ TARGET_BACKENDS=JS
|
||||
// CHECK_HAS_NO_INLINE_METADATA: applyO_h43q6c$ TARGET_BACKENDS=JS
|
||||
|
||||
inline
|
||||
public fun <T> apply(arg: T, func: (T)->T): T = func(arg)
|
||||
|
||||
+40
-8
@@ -1,12 +1,44 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1301
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=plus_za3lpa$ scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=plus scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=invoke scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_za3lpa$ scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_vux9f0$ scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=dec scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=minus_za3lpa$ scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=invoke_dqglrj$ scope=test
|
||||
|
||||
// CHECK_FUNCTION_EXISTS: plus_za3lpa$ TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=plus_za3lpa$ scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: plus_ha5a7z_k$ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=plus_ha5a7z_k$ scope=box IGNORED_BACKENDS=JS
|
||||
|
||||
// CHECK_FUNCTION_EXISTS: plus TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=plus scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: plus_0 IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=plus_0 scope=box IGNORED_BACKENDS=JS
|
||||
|
||||
// CHECK_FUNCTION_EXISTS: invoke TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=invoke scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: invoke_0_k$ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=invoke_0_k$ scope=box IGNORED_BACKENDS=JS
|
||||
|
||||
// CHECK_FUNCTION_EXISTS: get_za3lpa$ TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_za3lpa$ scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: get_ha5a7z_k$ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_ha5a7z_k$ scope=box IGNORED_BACKENDS=JS
|
||||
|
||||
// CHECK_FUNCTION_EXISTS: set_vux9f0$ TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_vux9f0$ scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: set_rvwcgf_k$ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_rvwcgf_k$ scope=box IGNORED_BACKENDS=JS
|
||||
|
||||
// CHECK_FUNCTION_EXISTS: dec TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=dec scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: dec_0_k$ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=dec_0_k$ scope=box IGNORED_BACKENDS=JS
|
||||
|
||||
// CHECK_FUNCTION_EXISTS: minus_za3lpa$ TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=minus_za3lpa$ scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: minus_ha5a7z_k$ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=minus_ha5a7z_k$ scope=box IGNORED_BACKENDS=JS
|
||||
|
||||
// CHECK_FUNCTION_EXISTS: invoke_dqglrj$ TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=invoke_dqglrj$ scope=test TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: invoke_tg9lle_k$ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=invoke_tg9lle_k$ scope=test_0_k$ IGNORED_BACKENDS=JS
|
||||
|
||||
class A {
|
||||
inline operator fun plus(a: Int) = a + 10
|
||||
|
||||
+92
-29
@@ -3,64 +3,100 @@ package test
|
||||
|
||||
var a = 0
|
||||
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p1 scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p1 scope=box
|
||||
// CHECK_FUNCTION_EXISTS: get_p1 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p1 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: set_p1 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p1 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _get_p1_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_get_p1_ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _set_p1_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_set_p1_ scope=box IGNORED_BACKENDS=JS
|
||||
private inline var p1: Int
|
||||
get() = a + 10000
|
||||
set(v) {
|
||||
a = v + 100
|
||||
}
|
||||
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p2 scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=set_p2 scope=box
|
||||
// CHECK_FUNCTION_EXISTS: get_p2 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p2 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=set_p2 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _get_p2_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_get_p2_ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=_set_p2_ scope=box IGNORED_BACKENDS=JS
|
||||
private var p2: Int
|
||||
inline get() = a + 20000
|
||||
set(v) {
|
||||
a = v + 200
|
||||
}
|
||||
|
||||
// CHECK_CALLED_IN_SCOPE: function=get_p3 scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p3 scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=get_p3 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: set_p3 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p3 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=_get_p3_ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _set_p3_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_set_p3_ scope=box IGNORED_BACKENDS=JS
|
||||
var p3: Int
|
||||
get() = a + 30000
|
||||
private inline set(v) {
|
||||
a = v + 300
|
||||
}
|
||||
|
||||
// CHECK_CALLED_IN_SCOPE: function=get_p4 scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p4 scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=get_p4 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: set_p4 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p4 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=_get_p4_ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _set_p4_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_set_p4_ scope=box IGNORED_BACKENDS=JS
|
||||
private var p4: Int
|
||||
get() = a + 40000
|
||||
inline set(v) {
|
||||
a = v + 400
|
||||
}
|
||||
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p5 scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p5 scope=box
|
||||
// CHECK_FUNCTION_EXISTS: get_p5 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p5 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: set_p5 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p5 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _get_p5_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_get_p5_ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _set_p5_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_set_p5_ scope=box IGNORED_BACKENDS=JS
|
||||
private inline var Int.p5: Int
|
||||
get() = this * 100 + a + 50000
|
||||
set(v) {
|
||||
a = this + v + 500
|
||||
}
|
||||
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p6 scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=set_p6 scope=box
|
||||
// CHECK_FUNCTION_EXISTS: get_p6 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p6 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=set_p6 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _get_p6_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_get_p6_ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=_set_p6_ scope=box IGNORED_BACKENDS=JS
|
||||
private var Int.p6: Int
|
||||
inline get() = this * 100 + a + 60000
|
||||
set(v) {
|
||||
a = this + v + 600
|
||||
}
|
||||
|
||||
// CHECK_CALLED_IN_SCOPE: function=get_p7 scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p7 scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=get_p7 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: set_p7 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p7 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=_get_p7_ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _set_p7_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_set_p7_ scope=box IGNORED_BACKENDS=JS
|
||||
var Int.p7: Int
|
||||
get() = this * 100 + a + 70000
|
||||
private inline set(v) {
|
||||
a = this + v + 700
|
||||
}
|
||||
|
||||
// CHECK_CALLED_IN_SCOPE: function=get_p8 scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p8 scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=get_p8 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: set_p8 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p8 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=_get_p8_ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _set_p8_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_set_p8_ scope=box IGNORED_BACKENDS=JS
|
||||
private var Int.p8: Int
|
||||
get() = this * 100 + a + 80000
|
||||
inline set(v) {
|
||||
@@ -90,24 +126,38 @@ private class A {
|
||||
a = v + 1100
|
||||
}
|
||||
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p12_s8ev3n$ scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p12_dqglrj$ scope=box
|
||||
// CHECK_FUNCTION_EXISTS: get_p12_s8ev3n$ TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p12_s8ev3n$ scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: set_p12_dqglrj$ TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p12_dqglrj$ scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _get_p12__quadv7_k$ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_get_p12__quadv7_k$ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _set_p12__e5dl2b_k$ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_set_p12__e5dl2b_k$ scope=box IGNORED_BACKENDS=JS
|
||||
inline var Int.p12: Int
|
||||
get() = this * 100 + a + 120000
|
||||
set(v) {
|
||||
a = this + v + 1200
|
||||
}
|
||||
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p13_s8ev3n$ scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=set_p13_dqglrj$ scope=box
|
||||
// CHECK_FUNCTION_EXISTS: get_p13_s8ev3n$ TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p13_s8ev3n$ scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=set_p13_dqglrj$ scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _get_p13__quadv7_k$ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_get_p13__quadv7_k$ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=_set_p13__e5dl2b_k$ scope=box IGNORED_BACKENDS=JS
|
||||
var Int.p13: Int
|
||||
inline get() = this * 100 + a + 130000
|
||||
set(v) {
|
||||
a = this + v + 1300
|
||||
}
|
||||
|
||||
// CHECK_CALLED_IN_SCOPE: function=get_p14_s8ev3n$ scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p14_dqglrj$ scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=get_p14_s8ev3n$ scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: set_p14_dqglrj$ TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p14_dqglrj$ scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=_get_p14__quadv7_k$ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _set_p14__e5dl2b_k$ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_set_p14__e5dl2b_k$ scope=box IGNORED_BACKENDS=JS
|
||||
var Int.p14: Int
|
||||
get() = this * 100 + a + 140000
|
||||
inline set(v) {
|
||||
@@ -115,25 +165,38 @@ private class A {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p15 scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p15 scope=box
|
||||
// CHECK_FUNCTION_EXISTS: get_p15 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p15 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: set_p15 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p15 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _get_p15_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_get_p15_ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _set_p15_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_set_p15_ scope=box IGNORED_BACKENDS=JS
|
||||
private inline var A.p15: Int
|
||||
get() = a + 150000
|
||||
set(v) {
|
||||
a = v + 1500
|
||||
}
|
||||
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p16 scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=set_p16 scope=box
|
||||
// CHECK_FUNCTION_EXISTS: get_p16 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=get_p16 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=set_p16 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _get_p16_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_get_p16_ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=_set_p16_ scope=box IGNORED_BACKENDS=JS
|
||||
private var A.p16: Int
|
||||
inline get() = a + 160000
|
||||
set(v) {
|
||||
a = v + 1600
|
||||
}
|
||||
|
||||
// CHECK_CALLED_IN_SCOPE: function=get_p17 scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p17 scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=get_p17 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: set_p17 TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=set_p17 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_CALLED_IN_SCOPE: function=_get_p17_ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: _set_p17_ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=_set_p17_ scope=box IGNORED_BACKENDS=JS
|
||||
private var A.p17: Int
|
||||
get() = a + 170000
|
||||
inline set(v) {
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1286
|
||||
package foo
|
||||
|
||||
// CHECK_NOT_CALLED: max
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=max scope=box
|
||||
|
||||
inline fun max(a: Int, b: Int): Int {
|
||||
log("max($a, $b)")
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ package foo
|
||||
|
||||
import test.*
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: testClassObject
|
||||
// CHECK_CONTAINS_NO_CALLS: testClassObject except=Companion_getInstance_18
|
||||
|
||||
internal fun testFinalInline(): String {
|
||||
return Z().finalInline({"final"})
|
||||
|
||||
@@ -22,7 +22,7 @@ inline fun Baz.call(a: Int) = "Baz.call($a)"
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=equals
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=equals TARGET_BACKENDS=JS
|
||||
|
||||
fun box(): String {
|
||||
var result = call(1)
|
||||
|
||||
@@ -13,7 +13,10 @@ public fun <T, R> apply(x: T, fn: (T)->R): R =
|
||||
|
||||
import utils.*
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: test except=imul
|
||||
// CHECK_CONTAINS_NO_CALLS: test except=imul TARGET_BACKENDS=JS
|
||||
|
||||
// FIXME: Not inlined on IR BE
|
||||
// CHECK_CONTAINS_NO_CALLS: test except=multiplyBy2 IGNORED_BACKENDS=JS
|
||||
|
||||
internal inline fun multiplyBy2(x: Int): Int = x * 2
|
||||
|
||||
@@ -23,4 +26,4 @@ fun box(): String {
|
||||
assertEquals(6, test(3))
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ inline fun foo() = O.bar()
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=bar
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=bar TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=bar_0_k$;O_getInstance; IGNORED_BACKENDS=JS
|
||||
|
||||
fun box() = foo()
|
||||
fun box() = foo()
|
||||
|
||||
@@ -28,7 +28,7 @@ class M1 : M2(), M3
|
||||
// MODULE: main(m1, m2, m3)
|
||||
// FILE: main.kt
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=equals;getKClass
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=equals;getKClass TARGET_BACKENDS=JS
|
||||
|
||||
fun box(): String {
|
||||
if (M1().foo() != 1) return "fail"
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// MODULE: main(module2)
|
||||
// FILE: main.kt
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=foo;bar;toString
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=foo;bar;toString TARGET_BACKENDS=JS
|
||||
|
||||
import A.test
|
||||
|
||||
|
||||
@@ -13,8 +13,13 @@ inline operator fun B.plus(b: Int) = b + 20
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=plus_za3lpa$ scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=plus scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=plus_za3lpa$ scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=plus scope=box TARGET_BACKENDS=JS
|
||||
|
||||
// CHECK_FUNCTION_EXISTS: plus_ha5a7z_k$ IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=plus_ha5a7z_k$ scope=box IGNORED_BACKENDS=JS
|
||||
// CHECK_FUNCTION_EXISTS: plus_0 IGNORED_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=plus_0 scope=box IGNORED_BACKENDS=JS
|
||||
|
||||
fun box(): String {
|
||||
var result = A() + 1
|
||||
|
||||
@@ -100,8 +100,8 @@ var A.p15: Int
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
// PROPERTY_NOT_USED: p1
|
||||
// PROPERTY_NOT_READ_FROM: p2
|
||||
// PROPERTY_NOT_USED: p1 scope=box
|
||||
// PROPERTY_NOT_READ_FROM: p2 scope=box
|
||||
// PROPERTY_NOT_WRITTEN_TO: p3
|
||||
// CHECK_NOT_CALLED: imported$get_p4
|
||||
// CHECK_NOT_CALLED: imported$set_p4
|
||||
|
||||
@@ -9,7 +9,7 @@ inline fun baz(x: String) = "baz(${foo(x)})"
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: a.kt
|
||||
// PROPERTY_READ_COUNT: name=foo_61zpoe$ count=1
|
||||
// PROPERTY_READ_COUNT: name=foo_61zpoe$ count=1 TARGET_BACKENDS=JS
|
||||
fun test1() = bar("q")
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1292
|
||||
package foo
|
||||
|
||||
// CHECK_VARS_COUNT: function=test1 count=0
|
||||
// CHECK_VARS_COUNT: function=test2 count=0
|
||||
// CHECK_VARS_COUNT: function=test3 count=0
|
||||
// CHECK_VARS_COUNT: function=test4 count=0
|
||||
// CHECK_VARS_COUNT: function=test5 count=2
|
||||
// FIXME: The IR backend generates a lot of redundant vars
|
||||
// CHECK_VARS_COUNT: function=test1 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_VARS_COUNT: function=test2 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_VARS_COUNT: function=test3 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_VARS_COUNT: function=test4 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_VARS_COUNT: function=test5 count=2 TARGET_BACKENDS=JS
|
||||
|
||||
var global = ""
|
||||
var globalNum = 1
|
||||
|
||||
@@ -4,7 +4,8 @@ package foo
|
||||
|
||||
// CHECK_NOT_CALLED: f1
|
||||
// CHECK_NOT_CALLED: f2
|
||||
// CHECK_BREAKS_COUNT: function=test count=3
|
||||
// CHECK_BREAKS_COUNT: function=test count=3 TARGET_BACKENDS=JS
|
||||
// CHECK_BREAKS_COUNT: function=test_1 count=6 IGNORED_BACKENDS=JS
|
||||
|
||||
internal var even = arrayListOf<Int>()
|
||||
internal var odd = arrayListOf<Int>()
|
||||
|
||||
+3
-1
@@ -5,7 +5,9 @@ inline fun foo(x: String = "x", y: String = "y") = x + y
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
// CHECK_VARS_COUNT: function=test count=0
|
||||
|
||||
// FIXME: The IR backend generates a lot of redundant vars
|
||||
// CHECK_VARS_COUNT: function=test count=0 TARGET_BACKENDS=JS
|
||||
|
||||
fun test() = foo() + ";" + foo(x = "X") + ";" + foo(y = "Y") + ";" + foo(x = "X", y = "Y")
|
||||
|
||||
|
||||
+2
-1
@@ -1,7 +1,8 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1281
|
||||
package foo
|
||||
|
||||
// CHECK_VARS_COUNT: function=test count=3
|
||||
// FIXME: The IR backend generates a lot of redundant vars
|
||||
// CHECK_VARS_COUNT: function=test count=3 TARGET_BACKENDS=JS
|
||||
|
||||
inline fun if1(f: (Int) -> Int, a: Int, b: Int, c: Int): Int {
|
||||
val result = f(a)
|
||||
|
||||
@@ -3,8 +3,10 @@ package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: test1
|
||||
// CHECK_CONTAINS_NO_CALLS: test2
|
||||
// CHECK_VARS_COUNT: function=test1 count=0
|
||||
// CHECK_VARS_COUNT: function=test2 count=1
|
||||
|
||||
// FIXME: The IR backend generates a lot of redundant vars
|
||||
// CHECK_VARS_COUNT: function=test1 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_VARS_COUNT: function=test2 count=1 TARGET_BACKENDS=JS
|
||||
|
||||
var log = ""
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1289
|
||||
// CHECK_VARS_COUNT: function=test1 count=0
|
||||
// CHECK_VARS_COUNT: function=test2 count=1
|
||||
// CHECK_VARS_COUNT: function=test3 count=0
|
||||
|
||||
// FIXME: The IR backend generates a lot of redundant vars
|
||||
// CHECK_VARS_COUNT: function=test1 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_VARS_COUNT: function=test2 count=1 TARGET_BACKENDS=JS
|
||||
// CHECK_VARS_COUNT: function=test3 count=0 TARGET_BACKENDS=JS
|
||||
|
||||
class A {
|
||||
var result = 1
|
||||
|
||||
Vendored
+3
-1
@@ -1,5 +1,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1287
|
||||
// CHECK_VARS_COUNT: function=box count=1
|
||||
|
||||
// FIXME: The IR backend generates a lot of redundant vars
|
||||
// CHECK_VARS_COUNT: function=box count=1 TARGET_BACKENDS=JS
|
||||
|
||||
package foo
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: test except=imul
|
||||
// CHECK_VARS_COUNT: function=test count=0
|
||||
|
||||
// FIXME: The IR backend generates a lot of redundant vars
|
||||
// CHECK_VARS_COUNT: function=test count=0 TARGET_BACKENDS=JS
|
||||
|
||||
// A copy of stdlib run function.
|
||||
// Copied to not to depend on run implementation.
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1288
|
||||
package foo
|
||||
|
||||
// CHECK_VARS_COUNT: function=test1 count=0
|
||||
// CHECK_VARS_COUNT: function=test2 count=1
|
||||
// CHECK_VARS_COUNT: function=test3 count=0
|
||||
// FIXME: The IR backend generates a lot of redundant vars
|
||||
// CHECK_VARS_COUNT: function=test1 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_VARS_COUNT: function=test2 count=1 TARGET_BACKENDS=JS
|
||||
// CHECK_VARS_COUNT: function=test3 count=0 TARGET_BACKENDS=JS
|
||||
|
||||
inline fun a(x: Int) = b(x)
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: test
|
||||
// CHECK_VARS_COUNT: function=test count=0
|
||||
|
||||
// FIXME: The IR backend generates a lot of redundant vars
|
||||
// CHECK_VARS_COUNT: function=test count=0 TARGET_BACKENDS=JS
|
||||
|
||||
internal class A(val x: Int) {
|
||||
inline fun f(): Int = x
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1283
|
||||
// CHECK_VARS_COUNT: function=test1 count=0
|
||||
// CHECK_VARS_COUNT: function=test2 count=0
|
||||
// CHECK_VARS_COUNT: function=test3 count=1
|
||||
|
||||
// FIXME: The IR backend generates a lot of redundant vars
|
||||
// CHECK_VARS_COUNT: function=test1 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_VARS_COUNT: function=test2 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_VARS_COUNT: function=test3 count=1 TARGET_BACKENDS=JS
|
||||
|
||||
inline fun foo(vararg x: String) = x.size
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1283
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: test
|
||||
// CHECK_CONTAINS_NO_CALLS: test except=Unit_getInstance
|
||||
|
||||
internal fun test(a: Int, b: Int): Int {
|
||||
var res = 0
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1286
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: testImplicitThis
|
||||
// CHECK_CONTAINS_NO_CALLS: testExplicitThis
|
||||
// CHECK_CONTAINS_NO_CALLS: testImplicitThis except=Unit_getInstance
|
||||
// CHECK_CONTAINS_NO_CALLS: testExplicitThis except=Unit_getInstance
|
||||
|
||||
internal class A(var value: Int)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1283
|
||||
// MODULE_KIND: COMMON_JS
|
||||
// FUNCTION_CALLED_TIMES: require count=2
|
||||
// FUNCTION_CALLED_TIMES: require count=2 TARGET_BACKENDS=JS
|
||||
// FUNCTION_CALLED_TIMES: require count=3 IGNORED_BACKENDS=JS
|
||||
|
||||
@JsModule("lib")
|
||||
external fun f(x: Int): String
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1285
|
||||
// MODULE_KIND: UMD
|
||||
// NO_JS_MODULE_SYSTEM
|
||||
// FUNCTION_CALLED_TIMES: require count=3
|
||||
// FUNCTION_CALLED_TIMES: require count=3 TARGET_BACKENDS=JS
|
||||
// FUNCTION_CALLED_TIMES: require count=2 IGNORED_BACKENDS=JS
|
||||
|
||||
@JsModule("lib")
|
||||
@JsNonModule
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1292
|
||||
// CHECK_LABELS_COUNT: function=test0 count=0
|
||||
// CHECK_LABELS_COUNT: function=test1 count=0
|
||||
// CHECK_LABELS_COUNT: function=test1 count=0 TARGET_BACKENDS=JS
|
||||
// CHECK_LABELS_COUNT: function=test2 count=0
|
||||
// CHECK_LABELS_COUNT: function=test3 count=0
|
||||
// CHECK_LABELS_COUNT: function=test3 count=0 TARGET_BACKENDS=JS
|
||||
|
||||
package foo
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1285
|
||||
package foo
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: test
|
||||
// CHECK_CONTAINS_NO_CALLS: test except=Unit_getInstance
|
||||
// CHECK_LABELS_COUNT: function=test name=loop count=1
|
||||
// CHECK_LABELS_COUNT: function=test name=loop_0 count=1
|
||||
// CHECK_LABELS_COUNT: function=test name=loop_1 count=1
|
||||
|
||||
+3
-1
@@ -1,7 +1,9 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1283
|
||||
package foo
|
||||
|
||||
// CHECK_LABELS_COUNT: function=test name=loop count=2
|
||||
// CHECK_LABELS_COUNT: function=test name=loop count=2 TARGET_BACKENDS=JS
|
||||
// CHECK_LABELS_COUNT: function=test name=loop count=1 IGNORED_BACKENDS=JS
|
||||
// CHECK_LABELS_COUNT: function=test name=loop_0 count=1 IGNORED_BACKENDS=JS
|
||||
|
||||
fun test() {
|
||||
var i = 0
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
package foo
|
||||
|
||||
// CHECK_NOT_CALLED: testInline
|
||||
// CHECK_LABELS_COUNT: function=testNoinline name=loop count=2
|
||||
// CHECK_LABELS_COUNT: function=testNoinline name=loop count=2 TARGET_BACKENDS=JS
|
||||
// CHECK_LABELS_COUNT: function=testNoinline name=loop count=1 IGNORED_BACKENDS=JS
|
||||
// CHECK_LABELS_COUNT: function=testNoinline name=loop_0 count=1 IGNORED_BACKENDS=JS
|
||||
|
||||
inline fun testInline(): Int {
|
||||
var c = 0
|
||||
|
||||
@@ -3,7 +3,9 @@ package foo
|
||||
|
||||
// CHECK_NOT_CALLED: testLabelInline
|
||||
// CHECK_LABELS_COUNT: function=testLabel name=loop count=1
|
||||
// CHECK_LABELS_COUNT: function=testLabel name=loop_0 count=2
|
||||
// CHECK_LABELS_COUNT: function=testLabel name=loop_0 count=2 TARGET_BACKENDS=JS
|
||||
// CHECK_LABELS_COUNT: function=testLabel name=loop_0 count=1 IGNORED_BACKENDS=JS
|
||||
// CHECK_LABELS_COUNT: function=testLabel name=loop_1 count=1 IGNORED_BACKENDS=JS
|
||||
|
||||
inline fun testLabelInline(): Int {
|
||||
var a = 0
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// KJS_WITH_FULL_RUNTIME
|
||||
// EXPECTED_REACHABLE_NODES: 1280
|
||||
// PROPERTY_WRITE_COUNT: name=publishedTopLevel_61zpoe$ count=1
|
||||
// PROPERTY_WRITE_COUNT: name=published_61zpoe$ count=1
|
||||
// PROPERTY_WRITE_COUNT: name=B count=1
|
||||
// PROPERTY_WRITE_COUNT: name=publishedTopLevel_61zpoe$ count=1 TARGET_BACKENDS=JS
|
||||
// PROPERTY_WRITE_COUNT: name=published_61zpoe$ count=1 TARGET_BACKENDS=JS
|
||||
// PROPERTY_WRITE_COUNT: name=published_6wfw3l_k$ count=1 IGNORED_BACKENDS=JS
|
||||
// PROPERTY_WRITE_COUNT: name=B count=1 TARGET_BACKENDS=JS
|
||||
class A {
|
||||
@PublishedApi
|
||||
internal fun published(x: String) = "${x}K"
|
||||
@@ -20,4 +21,4 @@ internal class B(val x: String) : I {
|
||||
override fun test() = x + "K"
|
||||
}
|
||||
|
||||
fun box(): String = "OK"
|
||||
fun box(): String = "OK"
|
||||
|
||||
js/js.translator/testData/box/multiModuleWrappers/common_js/inlineFromModuleWithNonIdentifierName.kt
Vendored
+1
-1
@@ -14,7 +14,7 @@ inline fun <reified T> boo() = "boo"
|
||||
// MODULE: main(#my-libr@ry)
|
||||
// FILE: box.kt
|
||||
// MODULE_KIND: COMMON_JS
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=assertEquals
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=assertEquals;assertEquals$default
|
||||
|
||||
fun box(): String {
|
||||
assertEquals("foo", foo())
|
||||
|
||||
Vendored
+2
-1
@@ -14,7 +14,8 @@ inline fun <reified T> boo() = "boo"
|
||||
// MODULE: main(#my-libr@ry)
|
||||
// FILE: box.kt
|
||||
// MODULE_KIND: PLAIN
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=assertEquals
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=assertEquals TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: box except=assertEquals$default IGNORED_BACKENDS=JS
|
||||
|
||||
fun box(): String {
|
||||
assertEquals("foo", foo())
|
||||
|
||||
@@ -20,8 +20,8 @@ inline fun ok() = A("O").s + A('K').s
|
||||
|
||||
|
||||
// TODO add directives for primary constructor invocations
|
||||
// CHECK_CALLED_IN_SCOPE: function=A_init_0 scope=box
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=A_init scope=box
|
||||
// CHECK_CALLED_IN_SCOPE: function=A_init_0 scope=box TARGET_BACKENDS=JS
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=A_init scope=box TARGET_BACKENDS=JS
|
||||
fun box(): String {
|
||||
if (A("O").s + A('K').s != "OK") return "fail"
|
||||
|
||||
|
||||
@@ -268,12 +268,12 @@ fun testLib2() {
|
||||
// FILE: main.kt
|
||||
package foo
|
||||
|
||||
// PROPERTY_READ_COUNT: name=longConst count=1 scope=testImportedLongConstInlinedFromOtherModule
|
||||
// PROPERTY_READ_COUNT: name=L42 count=1 scope=testImportedLongConstInlinedFromOtherModule
|
||||
// PROPERTY_READ_COUNT: name=L_42 count=4 scope=testImportedLongConstInlinedFromOtherModule
|
||||
// PROPERTY_READ_COUNT: name=L84 count=2 scope=testImportedLongConstInlinedFromOtherModule
|
||||
// PROPERTY_READ_COUNT: name=bigLongConst count=1 scope=testImportedLongConstInlinedFromOtherModule
|
||||
// PROPERTY_READ_COUNT: name=L123456789012345 count=1 scope=testImportedLongConstInlinedFromOtherModule
|
||||
// PROPERTY_READ_COUNT: name=longConst count=1 scope=testImportedLongConstInlinedFromOtherModule TARGET_BACKENDS=JS
|
||||
// PROPERTY_READ_COUNT: name=L42 count=1 scope=testImportedLongConstInlinedFromOtherModule TARGET_BACKENDS=JS
|
||||
// PROPERTY_READ_COUNT: name=L_42 count=4 scope=testImportedLongConstInlinedFromOtherModule TARGET_BACKENDS=JS
|
||||
// PROPERTY_READ_COUNT: name=L84 count=2 scope=testImportedLongConstInlinedFromOtherModule TARGET_BACKENDS=JS
|
||||
// PROPERTY_READ_COUNT: name=bigLongConst count=1 scope=testImportedLongConstInlinedFromOtherModule TARGET_BACKENDS=JS
|
||||
// PROPERTY_READ_COUNT: name=L123456789012345 count=1 scope=testImportedLongConstInlinedFromOtherModule TARGET_BACKENDS=JS
|
||||
fun testImportedLongConstInlinedFromOtherModule() {
|
||||
testImportedLongConstInlineFun()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1283
|
||||
// CHECK_VARS_COUNT: function=test count=1
|
||||
// CHECK_VARS_COUNT: function=test count=1 TARGET_BACKENDS=JS
|
||||
|
||||
class A {
|
||||
var i = 23
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1286
|
||||
// ONLY_THIS_QUALIFIED_REFERENCES: foo_0
|
||||
// ONLY_THIS_QUALIFIED_REFERENCES: foo_0 TARGET_BACKENDS=JS
|
||||
|
||||
package foo
|
||||
|
||||
@@ -15,4 +15,4 @@ fun box(): String {
|
||||
var result = A.bar()
|
||||
if (result != 23) return "failed: ${result}"
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
// CHECK_CONTAINS_NO_CALLS: inRange
|
||||
// CHECK_CONTAINS_NO_CALLS: inRange2
|
||||
// CHECK_CONTAINS_NO_CALLS: inRange3
|
||||
// CHECK_CONTAINS_NO_CALLS: inRange4
|
||||
// CHECK_CONTAINS_NO_CALLS: inRange4 TARGET_BACKENDS=JS
|
||||
|
||||
// CHECK_CONTAINS_NO_CALLS: inLongRange except=lessThanOrEqual;lessThan;fromInt
|
||||
// CHECK_CONTAINS_NO_CALLS: inLongRange2 except=lessThanOrEqual;lessThan;fromInt
|
||||
// CHECK_CONTAINS_NO_CALLS: inLongRange3 except=lessThanOrEqual;lessThan;fromInt
|
||||
// CHECK_CONTAINS_NO_CALLS: inLongRange4 except=lessThanOrEqual;lessThan;fromInt
|
||||
// CHECK_CONTAINS_NO_CALLS: inLongRange except=lessThanOrEqual;lessThan;fromInt TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: inLongRange2 except=lessThanOrEqual;lessThan;fromInt TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: inLongRange3 except=lessThanOrEqual;lessThan;fromInt TARGET_BACKENDS=JS
|
||||
// CHECK_CONTAINS_NO_CALLS: inLongRange4 except=lessThanOrEqual;lessThan;fromInt TARGET_BACKENDS=JS
|
||||
// CHECK_VARS_COUNT: function=inLongRange count=0
|
||||
// CHECK_VARS_COUNT: function=inLongRange2 count=0
|
||||
// CHECK_VARS_COUNT: function=inLongRange3 count=0
|
||||
|
||||
+2
-1
@@ -2,7 +2,8 @@
|
||||
package foo
|
||||
|
||||
// CHECK_NOT_CALLED: isTypeOfOrNull
|
||||
// CHECK_NULLS_COUNT: function=box count=10
|
||||
// CHECK_NULLS_COUNT: function=box count=10 TARGET_BACKENDS=JS
|
||||
// CHECK_NULLS_COUNT: function=box count=6 IGNORED_BACKENDS=JS
|
||||
|
||||
inline
|
||||
fun <reified T> Any?.isTypeOfOrNull() = this is T?
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
// EXPECTED_REACHABLE_NODES: 1682
|
||||
package foo
|
||||
|
||||
// CHECK_NOT_CALLED: test
|
||||
// CHECK_NOT_CALLED_IN_SCOPE: function=test scope=box
|
||||
|
||||
class A(val x: Int)
|
||||
class B(val x: Int)
|
||||
@@ -32,4 +32,4 @@ fun box(): String {
|
||||
assertEquals(listOf(b2, b4), test<B>(a1, a3, *objects, a3, b4), "test<B>(a1, a3, *objects, a3, b4)")
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
package foo
|
||||
|
||||
// NO_INLINE
|
||||
// CHECK_CALLED_IN_SCOPE: scope=box function=isInstanceOf
|
||||
// CHECK_CALLED_IN_SCOPE: scope=box function=isInstanceOf TARGET_BACKENDS=JS
|
||||
|
||||
class A
|
||||
class B
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user