[JS IR] Add tests for JS IR IC + PL

^KT-57347 related
This commit is contained in:
Alexander Korepanov
2023-05-08 16:54:30 +02:00
committed by Space Team
parent 97620030c6
commit 82a1242f22
96 changed files with 710 additions and 3 deletions
@@ -0,0 +1 @@
inline fun foo(): Int? = null
@@ -0,0 +1 @@
inline fun foo77(): Int? = 77
@@ -0,0 +1 @@
inline fun foo(): Int? = 3
@@ -0,0 +1 @@
inline fun foo(): Int? = null
@@ -0,0 +1 @@
inline fun bar() = 0
@@ -0,0 +1 @@
inline fun bar() = 4
@@ -0,0 +1,23 @@
STEP 0:
modifications:
U : l1a.0.kt -> l1a.kt
U : l1b.0.kt -> l1b.kt
added file: l1a.kt, l1b.kt
STEP 1:
modifications:
U : l1a.1.kt -> l1a.kt
modified ir: l1a.kt
updated exports: l1a.kt
STEP 2:
modifications:
U : l1b.2.kt -> l1b.kt
modified ir: l1b.kt
STEP 3:
modifications:
U : l1a.3.kt -> l1a.kt
modified ir: l1a.kt
updated exports: l1a.kt
STEP 4:
modifications:
U : l1a.4.kt -> l1a.kt
modified ir: l1a.kt
@@ -0,0 +1,11 @@
fun box(stepId: Int): String {
val x = test()
val expected = when (stepId) {
0, 1, 3, 4 -> stepId
2 -> 1
else -> return "Unknown"
}
if (expected != x) return "Fail; $expected != $x"
return "OK"
}
@@ -0,0 +1,8 @@
STEP 0:
dependencies: lib1
modifications:
added file: m.kt, test.kt
STEP 1..4:
dependencies: lib1
rebuild klib: false
updated imports: test.kt
@@ -0,0 +1,7 @@
fun test(): Int {
try {
return foo() ?: bar()
} catch (e: Error) {
return 1
}
}
@@ -0,0 +1,5 @@
MODULES: lib1, main
STEP 0..4:
libs: lib1, main
dirty js: lib1, main