Add WITH_RUNTIME or WITH_REFLECT to boxWithStdlib testData

This commit is contained in:
Alexander Udalov
2016-03-07 12:47:06 +03:00
committed by Alexander Udalov
parent 2564a2f91f
commit 22bfc9786a
525 changed files with 1122 additions and 164 deletions
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun box(): String =
if (listOf("abc", "de", "f").map(String::length) == listOf(3, 2, 1)) "OK" else "Fail"
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// KT-5665 // KT-5665
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import java.lang.reflect.Method import java.lang.reflect.Method
import kotlin.test.assertEquals import kotlin.test.assertEquals
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import java.lang.reflect.Method import java.lang.reflect.Method
import kotlin.test.assertEquals import kotlin.test.assertEquals
@@ -1,3 +1,5 @@
// WITH_RUNTIME
annotation class Ann(val v: String = "???") annotation class Ann(val v: String = "???")
@Ann open class My @Ann open class My
fun box(): String { fun box(): String {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.reflect.KClass import kotlin.reflect.KClass
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.reflect.KProperty import kotlin.reflect.KProperty
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@file:StringHolder("OK") @file:StringHolder("OK")
@file:JvmName("FileClass") @file:JvmName("FileClass")
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Ann(Foo.i, Foo.s, Foo.f, Foo.d, Foo.l, Foo.b, Foo.bool, Foo.c, Foo.str) class MyClass @Ann(Foo.i, Foo.s, Foo.f, Foo.d, Foo.l, Foo.b, Foo.bool, Foo.c, Foo.str) class MyClass
fun box(): String { fun box(): String {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Ann(i, s, f, d, l, b, bool, c, str) class MyClass @Ann(i, s, f, d, l, b, bool, c, str) class MyClass
fun box(): String { fun box(): String {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
annotation class A annotation class A
@Target(AnnotationTarget.CLASS) @Target(AnnotationTarget.CLASS)
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Ann(A.B.i) class MyClass @Ann(A.B.i) class MyClass
fun box(): String { fun box(): String {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val b: Byte, val b: Byte,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Ann(i) class MyClass @Ann(i) class MyClass
fun box(): String { fun box(): String {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
@kotlin.internal.LowPriorityInOverloadResolution @kotlin.internal.LowPriorityInOverloadResolution
fun foo(i: Int) = 1 fun foo(i: Int) = 1
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann(vararg val p: Int) annotation class Ann(vararg val p: Int)
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
fun simpleIntArray(): Array<Int> = Array(3) { it } fun simpleIntArray(): Array<Int> = Array(3) { it }
@@ -22,4 +24,3 @@ fun box(): String {
return "OK" return "OK"
} }
@@ -1,3 +1,5 @@
// WITH_RUNTIME
fun box(): String { fun box(): String {
val x: Array<List<*>> = arrayOf(listOf(1)) val x: Array<List<*>> = arrayOf(listOf(1))
val y : Array<in List<String>> = x val y : Array<in List<String>> = x
@@ -1,3 +1,5 @@
// WITH_RUNTIME
fun box(): String { fun box(): String {
val a = Array<Int>(5, {it}) val a = Array<Int>(5, {it})
val x = a.indices.iterator() val x = a.indices.iterator()
@@ -1,3 +1,5 @@
// WITH_RUNTIME
fun box(): String { fun box(): String {
val a = CharArray(5) val a = CharArray(5)
val x = a.indices.iterator() val x = a.indices.iterator()
+2 -1
View File
@@ -1,2 +1,3 @@
fun box() = if(arrayOfNulls<Int>(10).isArrayOf<java.lang.Integer>()) "OK" else "fail" // WITH_RUNTIME
fun box() = if(arrayOfNulls<Int>(10).isArrayOf<java.lang.Integer>()) "OK" else "fail"
@@ -1,3 +1,5 @@
// WITH_RUNTIME
fun box() : String { fun box() : String {
val value = (1 to doubleArrayOf(1.0)).second[0] val value = (1 to doubleArrayOf(1.0)).second[0]
return if (value == 1.0) "OK" else "fail" return if (value == 1.0) "OK" else "fail"
@@ -1,3 +1,5 @@
// WITH_RUNTIME
fun foo(x : Any): String { fun foo(x : Any): String {
return if(x is Array<*> && x.isArrayOf<String>()) (x as Array<String>)[0] else "fail" return if(x is Array<*> && x.isArrayOf<String>()) (x as Array<String>)[0] else "fail"
} }
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
fun stringMultiArray(): Array<Array<String>> = Array(3) { fun stringMultiArray(): Array<Array<String>> = Array(3) {
@@ -1,3 +1,4 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
@@ -1,3 +1,4 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
@@ -1,3 +1,4 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
fun box(): String { fun box(): String {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
fun test1() { fun test1() {
@@ -25,4 +27,3 @@ fun box(): String {
test2() test2()
return "OK" return "OK"
} }
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
fun checkLongAB5E(x: Long) = assertEquals(0xAB5EL, x) fun checkLongAB5E(x: Long) = assertEquals(0xAB5EL, x)
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
fun box(): String { fun box(): String {
@@ -1,3 +1,4 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
@@ -1,3 +1,4 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
@@ -30,4 +31,3 @@ fun box() : String {
return "OK" return "OK"
} }
@@ -1,3 +1,4 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
inline fun <R> foo(x : R, block : (R) -> R) : R { inline fun <R> foo(x : R, block : (R) -> R) : R {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
fun box(): String { fun box(): String {
@@ -1,3 +1,4 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
@@ -1,3 +1,4 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
import kotlin.jvm.internal.FunctionImpl import kotlin.jvm.internal.FunctionImpl
@@ -1,2 +0,0 @@
fun box(): String =
if (listOf("abc", "de", "f").map(String::length.getter) == listOf(3, 2, 1)) "OK" else "Fail"
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// This is a big, ugly, semi-auto generated test. // This is a big, ugly, semi-auto generated test.
// Use corresponding 'Small' test for debug. // Use corresponding 'Small' test for debug.
@@ -1,3 +1,5 @@
// WITH_RUNTIME
fun <T> test1() = null as T fun <T> test1() = null as T
fun <T> test2(): T { fun <T> test2(): T {
val a : Any? = null val a : Any? = null
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import java.util.* import java.util.*
class Itr : Iterator<String> by ArrayList<String>().iterator() class Itr : Iterator<String> by ArrayList<String>().iterator()
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// This is a big, ugly, semi-auto generated test. // This is a big, ugly, semi-auto generated test.
// Use corresponding 'Small' test for debug. // Use corresponding 'Small' test for debug.
@@ -1,3 +1,5 @@
// WITH_REFLECT
fun fn0() {} fun fn0() {}
fun fn1(x: Any) {} fun fn1(x: Any) {}
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import java.util.* import java.util.*
class Itr : Iterator<String> by ArrayList<String>().iterator() class Itr : Iterator<String> by ArrayList<String>().iterator()
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// This is a big, ugly, semi-auto generated test. // This is a big, ugly, semi-auto generated test.
// Use corresponding 'Small' test for debug. // Use corresponding 'Small' test for debug.
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import java.util.* import java.util.*
class Itr : Iterator<String> by ArrayList<String>().iterator() class Itr : Iterator<String> by ArrayList<String>().iterator()
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// This is a big, ugly, semi-auto generated test. // This is a big, ugly, semi-auto generated test.
// Use corresponding 'Small' test for debug. // Use corresponding 'Small' test for debug.
@@ -1,3 +1,5 @@
// WITH_RUNTIME
fun fn0() {} fun fn0() {}
fun fn1(x: Any) {} fun fn1(x: Any) {}
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import java.util.* import java.util.*
class Itr : Iterator<String> by ArrayList<String>().iterator() class Itr : Iterator<String> by ArrayList<String>().iterator()
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import java.util.* import java.util.*
class Itr : Iterator<String> by ArrayList<String>().iterator() class Itr : Iterator<String> by ArrayList<String>().iterator()
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// This is a big, ugly, semi-auto generated test. // This is a big, ugly, semi-auto generated test.
// Use corresponding 'Small' test for debug. // Use corresponding 'Small' test for debug.
@@ -1,3 +1,5 @@
// WITH_RUNTIME
fun fn0() {} fun fn0() {}
fun fn1(x: Any) {} fun fn1(x: Any) {}
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import java.util.* import java.util.*
class Itr : Iterator<String> by ArrayList<String>().iterator() class Itr : Iterator<String> by ArrayList<String>().iterator()
@@ -1,3 +1,5 @@
// WITH_RUNTIME
fun foo() {} fun foo() {}
fun box(): String { fun box(): String {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
fun unsupported(): Nothing = throw UnsupportedOperationException() fun unsupported(): Nothing = throw UnsupportedOperationException()
class Weird : Iterator<String>, MutableIterable<String>, MutableMap.MutableEntry<String, String> { class Weird : Iterator<String>, MutableIterable<String>, MutableMap.MutableEntry<String, String> {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
fun testFun1(str: String): String { fun testFun1(str: String): String {
val local = str val local = str
@@ -1,4 +1,4 @@
import kotlin.reflect.jvm.* // WITH_RUNTIME
abstract class Itr : Iterator<String> abstract class Itr : Iterator<String>
abstract class MItr : MutableIterator<String> abstract class MItr : MutableIterator<String>
@@ -1,3 +1,5 @@
// WITH_RUNTIME
const val z = "OK" const val z = "OK"
annotation class A(val value: String = z) annotation class A(val value: String = z)
@@ -1,3 +1,5 @@
// WITH_RUNTIME
interface KInt { interface KInt {
companion object { companion object {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
fun concatNonNulls(strings: List<String?>): String { fun concatNonNulls(strings: List<String?>): String {
var result = "" var result = ""
for (str in strings) { for (str in strings) {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
data class B(val x: Int) { data class B(val x: Int) {
fun equals(other: B): Boolean = false fun equals(other: B): Boolean = false
} }
@@ -1,3 +1,5 @@
// WITH_RUNTIME
data class A(val x: Int) { data class A(val x: Int) {
fun hashCode(other: Any): Int = 0 fun hashCode(other: Any): Int = 0
} }
@@ -1,3 +1,5 @@
// WITH_RUNTIME
data class A(val x: Int) { data class A(val x: Int) {
fun toString(other: Any): String = "" fun toString(other: Any): String = ""
} }
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.test.assertEquals import kotlin.test.assertEquals
fun foo(): Int { fun foo(): Int {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
class A(value: Int = 1) class A(value: Int = 1)
fun box(): String { fun box(): String {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
class A(val a: Int = 1, class A(val a: Int = 1,
val b: Int = 2, val b: Int = 2,
val c: Int = 3, val c: Int = 3,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
fun box(): String { fun box(): String {
return if (A().run() == "Aabc") "OK" else "fail" return if (A().run() == "Aabc") "OK" else "fail"
} }
@@ -1,3 +1,4 @@
// WITH_RUNTIME
fun def(i: Int = 0): Int { fun def(i: Int = 0): Int {
return i; return i;
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// See KT-10107: 'Variable must be initialized' for delegate with private set // See KT-10107: 'Variable must be initialized' for delegate with private set
class My { class My {
@@ -10,4 +11,3 @@ class My {
} }
fun box() = My().delegate fun box() = My().delegate
@@ -1,3 +1,5 @@
// WITH_RUNTIME
interface T { interface T {
} }
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.properties.Delegates import kotlin.properties.Delegates
object X { object X {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import kotlin.properties.Delegates import kotlin.properties.Delegates
open class A<T : Any> { open class A<T : Any> {
@@ -1,3 +1,4 @@
// WITH_REFLECT
// FULL_JDK // FULL_JDK
import java.lang.reflect.InvocationTargetException import java.lang.reflect.InvocationTargetException
@@ -1,3 +1,6 @@
// WITH_REFLECT
// TODO: replace with WITH_RUNTIME once KT-11316 is fixed
import java.util.* import java.util.*
import kotlin.reflect.* import kotlin.reflect.*
@@ -1,3 +1,5 @@
// WITH_RUNTIME
import Game.* import Game.*
enum class Game { enum class Game {
@@ -1,3 +1,5 @@
// WITH_RUNTIME
package test package test
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val b: Byte, val b: Byte,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val p1: Int, val p1: Int,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
abstract class BaseClass { abstract class BaseClass {
protected open val menuId: Int = 0 protected open val menuId: Int = 0
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val p1: Int, val p1: Int,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val p1: Int, val p1: Int,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val p1: Int, val p1: Int,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val p1: Byte, val p1: Byte,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val p1: Byte, val p1: Byte,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val p1: Byte, val p1: Byte,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val p1: Byte, val p1: Byte,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val p1: Byte, val p1: Byte,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val p1: Int, val p1: Int,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val p1: Byte, val p1: Byte,
@@ -1,3 +1,5 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
annotation class Ann( annotation class Ann(
val p1: Byte, val p1: Byte,
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// FULL_JDK // FULL_JDK
@file:JvmName("XYZ") @file:JvmName("XYZ")
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// FULL_JDK // FULL_JDK
import java.lang.reflect.Modifier import java.lang.reflect.Modifier
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// FULL_JDK // FULL_JDK
import java.util.LinkedList import java.util.LinkedList
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// FULL_JDK // FULL_JDK
import java.lang.reflect.Modifier import java.lang.reflect.Modifier
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// FULL_JDK // FULL_JDK
package foo package foo
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// FULL_JDK // FULL_JDK
class C { class C {
@@ -1,3 +1,4 @@
// WITH_RUNTIME
// FULL_JDK // FULL_JDK
package foo package foo

Some files were not shown because too many files have changed in this diff Show More