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:
backend.native/tests/external/codegen/blackbox/ranges/nullableLoopParameter/progressionExpression.kt
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
fun box(): String {
|
||||
var result = 0
|
||||
val intRange: IntProgression = 1..3
|
||||
for (i: Int? in intRange) {
|
||||
result = sum(result, i)
|
||||
}
|
||||
return if (result == 6) "OK" else "fail: $result"
|
||||
}
|
||||
|
||||
fun sum(i: Int, z: Int?): Int {
|
||||
return i + z!!
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
fun box(): String {
|
||||
var result = 0
|
||||
val intRange = 1..3
|
||||
for (i: Int? in intRange) {
|
||||
result = sum(result, i)
|
||||
}
|
||||
return if (result == 6) "OK" else "fail: $result"
|
||||
}
|
||||
|
||||
fun sum(i: Int, z: Int?): Int {
|
||||
return i + z!!
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
fun box(): String {
|
||||
var result = 0
|
||||
for (i: Int? in 1..3) {
|
||||
result = sum(result, i)
|
||||
}
|
||||
return if (result == 6) "OK" else "fail: $result"
|
||||
}
|
||||
|
||||
fun sum(i: Int, z: Int?): Int {
|
||||
return i + z!!
|
||||
}
|
||||
Reference in New Issue
Block a user