Files
kotlin-fork/compiler/testData/codegen/box/ranges/kt37370.kt
T
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00

66 lines
1.2 KiB
Kotlin
Vendored

// WITH_STDLIB
fun testContinue1() {
for (i in 0..1) {
for (j in continue downTo 1) {}
}
}
fun testContinue2() {
for (i in 0..1) {
for (j in 1 downTo continue) {}
}
}
fun falseCond() = false
fun testContinue3() {
for (i in 0..1) {
for (j in (if (falseCond()) 10 else continue) downTo 1) {}
}
}
fun testContinue4() {
for (i in 0..1) {
for (j in 10 downTo (if (falseCond()) 1 else continue)) {}
}
}
fun testContinue5() {
for (i in 0..1) {
for (j in (
if (try {
if (falseCond()) true else return
} finally {
if (!falseCond()) continue
}
)
10
else
continue
)
downTo 1) {
//...
}
}
}
fun start(i1: Int, i2: Int, i3: Int) = 10
fun testContinue6() {
for (i in 0..1) {
for (j in start(1, 2, continue) downTo 0) {
}
}
}
fun box(): String {
testContinue1()
testContinue2()
testContinue3()
testContinue4()
testContinue5()
testContinue6()
return "OK"
}