JS test: added inline tests

This commit is contained in:
Alexey Tsvetkov
2014-09-29 16:00:18 +04:00
committed by Zalim Bashorov
parent 987708680f
commit 3f2d4b31be
112 changed files with 4442 additions and 0 deletions
@@ -0,0 +1,18 @@
/*
* Copy of JVM-backend test
* Found at: compiler/testData/codegen/boxInline/capture/captureInlinable.1.kt
*/
package foo
import test.*
fun box(): String {
val result = doWork({11})
if (result != 11) return "test1: ${result}"
val result2 = doWork({12; result+1})
if (result2 != 12) return "test2: ${result2}"
return "OK"
}
@@ -0,0 +1,17 @@
/*
* Copy of JVM-backend test
* Found at: compiler/testData/codegen/boxInline/capture/captureInlinable.2.kt
*/
package test
import kotlin.InlineOption.*
inline fun <R> doWork(inlineOptions(ONLY_LOCAL_RETURN) job: ()-> R) : R {
return notInline({job()})
}
fun <R> notInline(job: ()-> R) : R {
return job()
}