Test framewrk update: check lambda inlining

This commit is contained in:
Michael Bogdanov
2015-04-13 11:57:23 +03:00
parent 27c40edeb4
commit 7025a4f933
41 changed files with 176 additions and 51 deletions
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun box() : String {
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun box() : String {
@@ -20,5 +21,4 @@ fun box() : String {
if (result != "OK11") return "fail $result"
return "OK"
}
}
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun test1(): String {
@@ -26,5 +27,4 @@ fun box() : String {
if (result2 != "OKGOOD") return "fail2 $result2"
return "OK"
}
}
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun test1(): String {
@@ -26,5 +27,4 @@ fun box() : String {
if (result2 != "OK11") return "fail2 $result2"
return "OK"
}
}
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import builders.*
fun testAllInline() : String {
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import builders.*
import kotlin.InlineOption.*
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun box(): String {
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun box(): String {
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun Data.test1(d: Data) : Long {
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import zzz.*
fun box(): String {
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun test1(): Int {
return 1.inlineMethod()
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun test1(s: Long): String {
@@ -1,10 +1,11 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
import java.util.*
fun test1(prefix: String): String {
var result = "fail"
mfun {
concat("start") {
noInline("start") {
if (it.startsWith(prefix)) {
result = "OK"
}
@@ -4,6 +4,6 @@ inline fun <R> mfun(f: () -> R) {
f()
}
fun concat(suffix: String, l: (s: String) -> Unit) {
fun noInline(suffix: String, l: (s: String) -> Unit) {
l(suffix)
}
@@ -1,5 +1,5 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
import kotlin.InlineOption.*
fun test1(param: String): String {
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun sameName(s: Long): Long {
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
import kotlin.InlineOption.*
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun test1(d: Data): Int {
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
fun box() : String {
test {"123"}
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
fun box() : String {
test {"123"}
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
fun test1(): Int {
return calc( { l: Int -> 2*l}, { l: Int -> 4*l})
}
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun test1(param: String): String {
@@ -1,5 +1,5 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
import kotlin.InlineOption.*
inline fun test1(inlineOptions(ONLY_LOCAL_RETURN) param: () -> String): String {
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
fun test1(): Int {
val inlineX = Inline()
var p = { l : Int -> l};
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun test1(b: Boolean): String {
@@ -90,7 +90,7 @@ fun box(): String {
}
public fun assertError(index: Int, h: Holder, expected: String, l: (h: Holder) -> Holder) {
inline fun assertError(index: Int, h: Holder, expected: String, l: (h: Holder) -> Holder) {
try {
l(h)
fail("fail $index: no error")
@@ -90,7 +90,7 @@ fun box(): String {
}
public fun assertError(index: Int, h: Holder, expected: String, l: (h: Holder) -> Holder) {
inline fun assertError(index: Int, h: Holder, expected: String, l: (h: Holder) -> Holder) {
try {
l(h)
fail("fail $index: no error")
@@ -53,7 +53,7 @@ fun box() : String {
return "OK"
}
public fun assertError(index: Int, expected: String, l: Test.()->Unit) {
inline fun assertError(index: Int, expected: String, l: Test.()->Unit) {
val testLocal = Test()
try {
testLocal.l()
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
fun box(): String {
@@ -1,3 +1,4 @@
//NO_CHECK_LAMBDA_INLINING
import test.*
val s = doWork({11})
@@ -15,7 +15,7 @@ fun test(): String {
fun box(): String {
return test()
}
//NO_CHECK_LAMBDA_INLINING
//SMAP
//lambda.1.kt
@@ -3,5 +3,5 @@ package builders
inline fun call(inlineOptions(InlineOption.ONLY_LOCAL_RETURN) init: () -> Unit) {
return init()
}
//NO_CHECK_LAMBDA_INLINING
//SMAP ABSENT
@@ -17,8 +17,8 @@ inline fun test(): String {
fun box(): String {
return test()
}
//NO_CHECK_LAMBDA_INLINING
//TODO SHOULD BE LESS
//SMAP
//lambdaOnInlineCallSite.1.kt
//Kotlin
@@ -15,7 +15,7 @@ fun test(): String {
fun box(): String {
return test()
}
//NO_CHECK_LAMBDA_INLINING
//SMAP
//object.1.kt
//Kotlin
@@ -19,7 +19,7 @@ fun test(): String {
fun box(): String {
return test()
}
//NO_CHECK_LAMBDA_INLINING
//SMAP
//objectOnCallSite.1.kt
@@ -19,8 +19,8 @@ inline fun test(): String {
fun box(): String {
return test()
}
//NO_CHECK_LAMBDA_INLINING
//TODO SHOULD BE LESS
//SMAP
//objectOnInlineCallSite.1.kt
//Kotlin
@@ -4,7 +4,7 @@ import kotlin.InlineOption.*
fun box(): String {
return test()
}
//NO_CHECK_LAMBDA_INLINING
//SXMAP
//objectOnInlineCallSite2.1.kt
@@ -4,6 +4,6 @@ import kotlin.InlineOption.*
fun box(): String {
return test{"OK"}
}
//NO_CHECK_LAMBDA_INLINING
//TODO