Files
kotlin-fork/compiler/testData/codegen/box/fir/unqualifiedEnum.kt
T
Ilya Chernikov 5b3816cce5 Test infra: refactor IGNORE_BACKEND directive
treat it as a general one, introduce *_K1 and *_K2 variants for
more specific ignoring
2022-11-12 16:28:23 +01:00

33 lines
504 B
Kotlin
Vendored

// TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_K1: JVM_IR
// WITH_STDLIB
enum class Rainbow {
RED,
ORANGE,
YELLOW,
GREEN,
CYAN,
BLUE,
VIOLET
}
fun sym(r: Rainbow) = when (r) {
RED -> 'r'
ORANGE -> 'o'
YELLOW -> 'y'
GREEN -> 'g'
CYAN -> 'c'
BLUE -> 'b'
VIOLET -> 'v'
}
fun box(): String {
val s = buildString {
for (value in Rainbow.values()) {
append(sym(value))
}
}
return if (s == "roygcbv") "OK" else s
}