[JS IR] Make tests that use directives pass with IR BE

This commit is contained in:
Sergej Jaskiewicz
2021-10-04 20:44:06 +03:00
committed by Space
parent a359e503fb
commit 65d40c2253
101 changed files with 415 additions and 217 deletions
@@ -1,11 +1,12 @@
// EXPECTED_REACHABLE_NODES: 1292
package foo
// CHECK_VARS_COUNT: function=test1 count=0
// CHECK_VARS_COUNT: function=test2 count=0
// CHECK_VARS_COUNT: function=test3 count=0
// CHECK_VARS_COUNT: function=test4 count=0
// CHECK_VARS_COUNT: function=test5 count=2
// FIXME: The IR backend generates a lot of redundant vars
// CHECK_VARS_COUNT: function=test1 count=0 TARGET_BACKENDS=JS
// CHECK_VARS_COUNT: function=test2 count=0 TARGET_BACKENDS=JS
// CHECK_VARS_COUNT: function=test3 count=0 TARGET_BACKENDS=JS
// CHECK_VARS_COUNT: function=test4 count=0 TARGET_BACKENDS=JS
// CHECK_VARS_COUNT: function=test5 count=2 TARGET_BACKENDS=JS
var global = ""
var globalNum = 1
@@ -4,7 +4,8 @@ package foo
// CHECK_NOT_CALLED: f1
// CHECK_NOT_CALLED: f2
// CHECK_BREAKS_COUNT: function=test count=3
// CHECK_BREAKS_COUNT: function=test count=3 TARGET_BACKENDS=JS
// CHECK_BREAKS_COUNT: function=test_1 count=6 IGNORED_BACKENDS=JS
internal var even = arrayListOf<Int>()
internal var odd = arrayListOf<Int>()
@@ -5,7 +5,9 @@ inline fun foo(x: String = "x", y: String = "y") = x + y
// MODULE: main(lib)
// FILE: main.kt
// CHECK_VARS_COUNT: function=test count=0
// FIXME: The IR backend generates a lot of redundant vars
// CHECK_VARS_COUNT: function=test count=0 TARGET_BACKENDS=JS
fun test() = foo() + ";" + foo(x = "X") + ";" + foo(y = "Y") + ";" + foo(x = "X", y = "Y")
@@ -1,7 +1,8 @@
// EXPECTED_REACHABLE_NODES: 1281
package foo
// CHECK_VARS_COUNT: function=test count=3
// FIXME: The IR backend generates a lot of redundant vars
// CHECK_VARS_COUNT: function=test count=3 TARGET_BACKENDS=JS
inline fun if1(f: (Int) -> Int, a: Int, b: Int, c: Int): Int {
val result = f(a)
@@ -3,8 +3,10 @@ package foo
// CHECK_CONTAINS_NO_CALLS: test1
// CHECK_CONTAINS_NO_CALLS: test2
// CHECK_VARS_COUNT: function=test1 count=0
// CHECK_VARS_COUNT: function=test2 count=1
// FIXME: The IR backend generates a lot of redundant vars
// CHECK_VARS_COUNT: function=test1 count=0 TARGET_BACKENDS=JS
// CHECK_VARS_COUNT: function=test2 count=1 TARGET_BACKENDS=JS
var log = ""
@@ -1,7 +1,9 @@
// EXPECTED_REACHABLE_NODES: 1289
// CHECK_VARS_COUNT: function=test1 count=0
// CHECK_VARS_COUNT: function=test2 count=1
// CHECK_VARS_COUNT: function=test3 count=0
// FIXME: The IR backend generates a lot of redundant vars
// CHECK_VARS_COUNT: function=test1 count=0 TARGET_BACKENDS=JS
// CHECK_VARS_COUNT: function=test2 count=1 TARGET_BACKENDS=JS
// CHECK_VARS_COUNT: function=test3 count=0 TARGET_BACKENDS=JS
class A {
var result = 1
@@ -1,5 +1,7 @@
// EXPECTED_REACHABLE_NODES: 1287
// CHECK_VARS_COUNT: function=box count=1
// FIXME: The IR backend generates a lot of redundant vars
// CHECK_VARS_COUNT: function=box count=1 TARGET_BACKENDS=JS
package foo
@@ -2,7 +2,9 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test except=imul
// CHECK_VARS_COUNT: function=test count=0
// FIXME: The IR backend generates a lot of redundant vars
// CHECK_VARS_COUNT: function=test count=0 TARGET_BACKENDS=JS
// A copy of stdlib run function.
// Copied to not to depend on run implementation.
@@ -1,9 +1,10 @@
// EXPECTED_REACHABLE_NODES: 1288
package foo
// CHECK_VARS_COUNT: function=test1 count=0
// CHECK_VARS_COUNT: function=test2 count=1
// CHECK_VARS_COUNT: function=test3 count=0
// FIXME: The IR backend generates a lot of redundant vars
// CHECK_VARS_COUNT: function=test1 count=0 TARGET_BACKENDS=JS
// CHECK_VARS_COUNT: function=test2 count=1 TARGET_BACKENDS=JS
// CHECK_VARS_COUNT: function=test3 count=0 TARGET_BACKENDS=JS
inline fun a(x: Int) = b(x)
+3 -1
View File
@@ -2,7 +2,9 @@
package foo
// CHECK_CONTAINS_NO_CALLS: test
// CHECK_VARS_COUNT: function=test count=0
// FIXME: The IR backend generates a lot of redundant vars
// CHECK_VARS_COUNT: function=test count=0 TARGET_BACKENDS=JS
internal class A(val x: Int) {
inline fun f(): Int = x
@@ -1,7 +1,9 @@
// EXPECTED_REACHABLE_NODES: 1283
// CHECK_VARS_COUNT: function=test1 count=0
// CHECK_VARS_COUNT: function=test2 count=0
// CHECK_VARS_COUNT: function=test3 count=1
// FIXME: The IR backend generates a lot of redundant vars
// CHECK_VARS_COUNT: function=test1 count=0 TARGET_BACKENDS=JS
// CHECK_VARS_COUNT: function=test2 count=0 TARGET_BACKENDS=JS
// CHECK_VARS_COUNT: function=test3 count=1 TARGET_BACKENDS=JS
inline fun foo(vararg x: String) = x.size