backend/tests: Add blackbox tests from Kotlin JVM

Added tests from testData/codegen/box directory. There are blackbox tests
in other directories and they are to be added.
This commit is contained in:
Ilya Matveev
2017-01-12 19:43:20 +07:00
parent d5988297b1
commit 1b553ebfaf
2643 changed files with 66666 additions and 0 deletions
@@ -0,0 +1,33 @@
class A {
fun get(vararg x: Int) = x.size
}
class B {
fun get(vararg x: Unit) = x.size
}
fun test1(a: A): Int {
return a.get(1)
}
fun test2(a: A): Int {
return a.get(1, 2)
}
fun test3(b: B): Int {
return b.get(Unit, Unit)
}
fun box() : String {
var result = test1(A())
if (result != 1) return "fail1: $result"
result = test2(A())
if (result != 2) return "fail2: $result"
result = test3(B())
if (result != 2) return "fail3: $result"
return "OK"
}