Migrate boxInline tests to new multi-file framework

This commit is contained in:
Alexander Udalov
2016-02-24 13:29:32 +03:00
committed by Alexander Udalov
parent fa1f7d988e
commit cc84aabdcf
586 changed files with 6946 additions and 5639 deletions
@@ -1,11 +0,0 @@
//NO_CHECK_LAMBDA_INLINING
fun box(): String {
val res = { "OK" }.test()()
if (res != "OKOKOK") return "fail 1: $res"
val res2 = { "OK" }.extensionNoInline().subSequence(0, 2)
if (res2 != "OK") return "fail 2: $res2"
return "OK"
}
@@ -1,4 +0,0 @@
inline fun (() -> String).test(): (() -> String) = { invoke() + this.invoke() + this() }
// call this.hashCode() guarantees that extension receiver is noinline by default
inline fun (() -> String).extensionNoInline(): String = this() + (this.hashCode().toString())
@@ -0,0 +1,20 @@
// FILE: 1.kt
inline fun (() -> String).test(): (() -> String) = { invoke() + this.invoke() + this() }
// call this.hashCode() guarantees that extension receiver is noinline by default
inline fun (() -> String).extensionNoInline(): String = this() + (this.hashCode().toString())
// FILE: 2.kt
//NO_CHECK_LAMBDA_INLINING
fun box(): String {
val res = { "OK" }.test()()
if (res != "OKOKOK") return "fail 1: $res"
val res2 = { "OK" }.extensionNoInline().subSequence(0, 2)
if (res2 != "OK") return "fail 2: $res2"
return "OK"
}
@@ -1,3 +0,0 @@
inline fun <T> test(p: T) {
p.toString()
}
@@ -1,6 +1,14 @@
// FILE: 1.kt
inline fun <T> test(p: T) {
p.toString()
}
// FILE: 2.kt
//NO_CHECK_LAMBDA_INLINING
fun box() : String {
test {"123"}
return "OK"
}
}
@@ -1,3 +0,0 @@
inline fun test(p: Any) {
p.toString()
}
@@ -1,6 +1,14 @@
// FILE: 1.kt
inline fun test(p: Any) {
p.toString()
}
// FILE: 2.kt
//NO_CHECK_LAMBDA_INLINING
fun box() : String {
test {"123"}
return "OK"
}
}
@@ -1,4 +0,0 @@
inline fun calc(s: (Int) -> Int, noinline p: (Int) -> Int) : Int {
val z = p
return s(11) + z(11) + p(11)
}
@@ -1,3 +1,12 @@
// FILE: 1.kt
inline fun calc(s: (Int) -> Int, noinline p: (Int) -> Int) : Int {
val z = p
return s(11) + z(11) + p(11)
}
// FILE: 2.kt
//NO_CHECK_LAMBDA_INLINING
fun test1(): Int {
return calc( { l: Int -> 2*l}, { l: Int -> 4*l})
@@ -8,4 +17,4 @@ fun box(): String {
if (test1() != 110) return "test1: ${test1()}"
return "OK"
}
}
@@ -1,5 +0,0 @@
package test
inline fun <T> inlineFun(arg: T, f: (T) -> Unit) {
f(arg)
}
@@ -1,3 +1,13 @@
// FILE: 1.kt
package test
inline fun <T> inlineFun(arg: T, f: (T) -> Unit) {
f(arg)
}
// FILE: 2.kt
//NO_CHECK_LAMBDA_INLINING
import test.*
@@ -58,4 +68,4 @@ fun box(): String {
if (test3("start") != "start12") return "fail3: ${test3("start")}"
return "OK"
}
}
@@ -1,5 +0,0 @@
package test
inline fun <T> inlineFun(arg: T, f: (T) -> Unit) {
f(arg)
}
@@ -1,3 +1,13 @@
// FILE: 1.kt
package test
inline fun <T> inlineFun(arg: T, f: (T) -> Unit) {
f(arg)
}
// FILE: 2.kt
//NO_CHECK_LAMBDA_INLINING
import test.*
@@ -70,4 +80,4 @@ fun box(): String {
else "OK"
} ()
}
}
@@ -1,7 +0,0 @@
class Inline {
inline fun calc(s: (Int) -> Int, p: Int) : Int {
return s(p)
}
}
@@ -1,3 +1,14 @@
// FILE: 1.kt
class Inline {
inline fun calc(s: (Int) -> Int, p: Int) : Int {
return s(p)
}
}
// FILE: 2.kt
//NO_CHECK_LAMBDA_INLINING
fun test1(): Int {
val inlineX = Inline()
@@ -9,4 +20,4 @@ fun box(): String {
if (test1() != 25) return "test1: ${test1()}"
return "OK"
}
}