Minor. Add regression tests

#KT-64725 Fixed
 #KT-64726 Fixed
 #KT-64727 Fixed
This commit is contained in:
Ilmir Usmanov
2024-03-04 20:13:57 +01:00
committed by Space Team
parent b4c2164837
commit 0bb6359ac5
13 changed files with 386 additions and 0 deletions
@@ -0,0 +1,48 @@
// See KT-64726
// IGNORE_INLINER: IR
// IGNORE_BACKEND: WASM
// FILE: test.kt
inline fun String.switchMapOnce(crossinline mapper: (String) -> String): String {
return { mapper(this) }.let { it() }
}
fun box() {
"O".switchMapOnce {
"K".switchMapOnce {
"OK"
} // Should be present
}
}
// EXPECTATIONS JVM_IR
// test.kt:10 box
// test.kt:6 box
// fake.kt:1 box
// test.kt:6 box
// test.kt:6 invoke
// test.kt:12 invoke
// test.kt:6 invoke
// fake.kt:1 invoke
// test.kt:6 invoke
// test.kt:6 invoke
// test.kt:13 invoke
// test.kt:6 invoke
// test.kt:6 invoke
// test.kt:14 invoke
// test.kt:6 invoke
// test.kt:6 box
// test.kt:16 box
// EXPECTATIONS JS_IR
// test.kt:6 box$lambda
// test.kt:6 box
// test.kt:6 box$lambda$lambda
// test.kt:6 box$lambda$lambda
// test.kt:6 box$lambda$lambda
// test.kt:6 box$lambda$lambda$lambda
// test.kt:16 box
// EXPECTATIONS WASM
// test.kt:10 $box (8, 4, 4, 4, 4, 8)
// test.kt:16 $box