[K/N] Basic support of Enum.entries for Native

No forward compatibility yet, with old klib IR linker will fail.

^KT-53324
This commit is contained in:
Pavel Kunyavskiy
2022-08-18 17:23:55 +02:00
committed by Space
parent 8cde6fe3c5
commit 895a8ff149
14 changed files with 199 additions and 40 deletions
@@ -0,0 +1,19 @@
// !LANGUAGE: +EnumEntries
// TARGET_BACKEND: JVM_IR
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: NATIVE
// WITH_STDLIB
enum class EnumWithClash {
values,
entries,
valueOf;
}
@OptIn(ExperimentalStdlibApi::class)
fun box(): String {
val ref = EnumWithClash::entries
if (ref().toString() != "[values, entries, valueOf]") return "FAIL 1"
if (EnumWithClash.entries.toString() != "entries") return "FAIL 2"
return "OK"
}