Support basic reification in IR

This commit is contained in:
Mikhael Bogdanov
2019-04-04 15:47:57 +02:00
parent 02cb1d7dcc
commit 4c59d161d4
54 changed files with 35 additions and 66 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
typealias ArrayS = Array<String>
fun testArray() {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
// FILE: A.java
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
@@ -1,5 +1,4 @@
// KJS_WITH_FULL_RUNTIME
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
class Itr : Iterator<String> by ArrayList<String>().iterator()
@@ -1,5 +1,4 @@
// KJS_WITH_FULL_RUNTIME
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
class Itr : Iterator<String> by ArrayList<String>().iterator()
@@ -1,5 +1,4 @@
// KJS_WITH_FULL_RUNTIME
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
class Itr : Iterator<String> by ArrayList<String>().iterator()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun bar(block: () -> String) : String {
return block()
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun doCall(f: () -> Any) = f()
fun test1() {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
class TestClass {
companion object {
inline operator fun <T> invoke(task: () -> T) = task()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
class TestClass {
inline operator fun <T> invoke(task: () -> T) = task()
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
object ExtProvider {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
@@ -1,5 +1,4 @@
// KJS_WITH_FULL_RUNTIME
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
fun foo() {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun <T> outer(command: () -> T) : T = command()
inline fun <K> inner(action: () -> K): K = action()
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
@@ -1,5 +1,4 @@
// KJS_WITH_FULL_RUNTIME
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
fun bar1(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
-1
View File
@@ -1,5 +1,4 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JVM_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun <reified T> Any?.check(): Boolean {
return this is T
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
import kotlin.test.assertEquals
-1
View File
@@ -1,5 +1,4 @@
// KJS_WITH_FULL_RUNTIME
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
import kotlin.test.assertEquals
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
import kotlin.test.assertEquals
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// FILE: 1.kt
// WITH_RUNTIME
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// FILE: 1.kt
// WITH_RUNTIME
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// FILE: 1.kt
package test
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun <R, T> foo(x : R?, block : (R?) -> T) : T {
return block(x)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun <R, T> foo(x : R?, y : R?, block : (R?) -> T) : T {
if (x == null) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun runNoInline(f: () -> Unit) = f()
fun test() {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
fun test(list: List<String>) {
val result = mutableListOf<String>()
use1 { list.forEach { result.add(it) } }
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun test(s: ()->Int){
var i = 0;
i = s()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// For mutable collections and related types (e.g., MutableList, MutableListIterator)
// 'as?' should be generated as a single 'safeAs...' intrinsic call
// without instanceof or 'is...'.
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun test(s: ()->Int){
var i = 0;
try {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun test(s: ()->Int){
var i = 0;
try {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// FILE: test.kt
fun test1() {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// FILE: test.kt
fun test1(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun <reified T> Any?.isa() = this is T
// 1 INSTANCEOF
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun <reified T> isNullable() = null is T
// 1 INSTANCEOF
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
val nonConstFlag = true
inline fun <T, R> calc(value : T, fn: (T) -> R) : R = fn(value)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun <reified T> Any?.foo() = this as T
inline fun <reified Y> Any?.foo2() = foo<Y?>()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun <reified T> Any?.foo() = this as T?
inline fun <reified Y> Any?.foo2() = foo<Y?>()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun <reified T> Any?.foo() = this is T
inline fun <reified Y> Any?.foo2() = foo<Y?>()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
inline fun <reified T> Any?.foo() = this is T?
inline fun <reified Y> Any?.foo2() = foo<Y?>()