[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() = -1
@@ -0,0 +1 @@
inline fun foo() = 1
@@ -0,0 +1 @@
inline fun inlineFoo(f: () -> Int) = f() + 1
@@ -0,0 +1 @@
inline fun inlineBar(f: () -> Int) = f() + 1
@@ -0,0 +1 @@
inline fun inlineFoo(f: () -> Int) = f() + 2
@@ -0,0 +1 @@
inline fun inlineFoo(f: () -> Int) = f() + 3
@@ -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 : l1b.1.kt -> l1b.kt
modified ir: l1b.kt
updated exports: l1b.kt
STEP 2:
modifications:
U : l1a.2.kt -> l1a.kt
modified ir: l1a.kt
STEP 3:
modifications:
U : l1b.3.kt -> l1b.kt
modified ir: l1b.kt
updated exports: l1b.kt
STEP 4:
modifications:
U : l1b.4.kt -> l1b.kt
modified ir: l1b.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 inlineFoo { foo() }
} catch (e: Error) {
return 1
}
}
@@ -0,0 +1,5 @@
MODULES: lib1, main
STEP 0..4:
libs: lib1, main
dirty js: lib1, main