blob: 4af7805b4dde98046d86994e48c797f060d10a51 [file]
// FILE: lib.kt
package foo
// CHECK_CONTAINS_NO_CALLS: myMultiply except=A;imul;new_foo_A_eb0rqk_k$
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)
// FILE: main.kt
package foo
import kotlin.test.*
// CHECK_CONTAINS_NO_CALLS: myMultiply except=A;imul;new_foo_A_eb0rqk_k$
// CHECK_BREAKS_COUNT: function=myMultiply count=0
// CHECK_LABELS_COUNT: function=myMultiply name=$l$block count=0
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, myMultiply(3, 5, 7))
return "OK"
}