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,23 @@
package foo
// CHECK_CONTAINS_NO_CALLS: doNothingNoInline
inline fun <T> doNothing1(a: T): T {
return a
}
inline fun <T> doNothing2(a: T, inline f: (T) -> T): T {
return f(a)
}
fun doNothingNoInline(a: Int): Int {
return doNothing2(a, {(x) -> doNothing1(x)})
}
fun box(): String {
assertEquals(1, doNothingNoInline(1))
assertEquals(12, doNothingNoInline(12))
assertEquals(12, doNothingNoInline(12))
return "OK"
}