Move 'bytecodeText' java 8 tests to common

This commit is contained in:
Mikhael Bogdanov
2018-10-22 17:19:57 +02:00
parent 4284c19a16
commit c6b4bae81f
9 changed files with 82 additions and 104 deletions
@@ -0,0 +1,25 @@
// JVM_TARGET: 1.8
data class Hash(
val a: Boolean,
val b: Byte,
val c: Char,
val d: Short,
val e: Int,
val f: Long,
val g: Float,
val j: Double,
val k: Any
)
// 8 \.hashCode
// 0 INVOKESTATIC java/lang/Boolean\.hashCode \(Z\)I
// 1 INVOKESTATIC java/lang/Byte\.hashCode \(B\)I
// 1 INVOKESTATIC java/lang/Character\.hashCode \(C\)I
// 1 INVOKESTATIC java/lang/Short\.hashCode \(S\)I
// 1 INVOKESTATIC java/lang/Integer\.hashCode \(I\)I
// 1 INVOKESTATIC java/lang/Long\.hashCode \(J\)I
// 1 INVOKESTATIC java/lang/Float\.hashCode \(F\)I
// 1 INVOKESTATIC java/lang/Double\.hashCode \(D\)I
// 1 INVOKEVIRTUAL java/lang/Object\.hashCode \(\)I
@@ -0,0 +1,26 @@
// JVM_TARGET: 1.8
fun box(): String {
true.hashCode()
1.toByte().hashCode()
1.toChar().hashCode()
1.toShort().hashCode()
1.hashCode()
1L.hashCode()
1.0F.hashCode()
1.0.hashCode()
"".hashCode()
return "OK"
}
// 9 \.hashCode
// 1 INVOKESTATIC java/lang/Boolean\.hashCode \(Z\)I
// 1 INVOKESTATIC java/lang/Byte\.hashCode \(B\)I
// 1 INVOKESTATIC java/lang/Character\.hashCode \(C\)I
// 1 INVOKESTATIC java/lang/Short\.hashCode \(S\)I
// 1 INVOKESTATIC java/lang/Integer\.hashCode \(I\)I
// 1 INVOKESTATIC java/lang/Long\.hashCode \(J\)I
// 1 INVOKESTATIC java/lang/Float\.hashCode \(F\)I
// 1 INVOKESTATIC java/lang/Double\.hashCode \(D\)I
// 1 INVOKEVIRTUAL java/lang/String\.hashCode \(\)I
@@ -0,0 +1,20 @@
// !API_VERSION: 1.3
// !JVM_DEFAULT_MODE: compatibility
// JVM_TARGET: 1.8
// WITH_RUNTIME
// FULL_JDK
interface KInterface {
@JvmDefault
fun test(s: String ="OK"): String {
return s
}
}
// 1 INVOKESTATIC KInterface.access\$test\$jd
// 1 INVOKESTATIC KInterface.test\$default
// from $default
// 1 INVOKEINTERFACE KInterface.test
//from $jd
// 1 INVOKESPECIAL KInterface.test
@@ -0,0 +1,20 @@
// !API_VERSION: 1.3
// !JVM_DEFAULT_MODE: compatibility
// JVM_TARGET: 1.8
interface KInterface {
@JvmDefault
fun test2(): String {
return "OK"
}
}
interface KInterface2 : KInterface {
}
// 1 INVOKESTATIC KInterface2.access\$test2\$jd
// 1 INVOKESTATIC KInterface.access\$test2\$jd
// 1 INVOKESPECIAL KInterface2.test2
// 1 INVOKESPECIAL KInterface.test2
@@ -0,0 +1,24 @@
// !API_VERSION: 1.3
// !JVM_DEFAULT_MODE: compatibility
// JVM_TARGET: 1.8
interface KInterface {
@JvmDefault
fun test2(): String {
return "OK"
}
}
interface KInterface2 : KInterface {
@JvmDefault
abstract override fun test2(): String
}
// 1 INVOKESTATIC KInterface.access\$test2\$jd
// +
// 0 INVOKESTATIC KInterface2.access\$test2\$jd
// =
// 1 INVOKESTATIC
// 1 INVOKESPECIAL KInterface.test2
// 0 INVOKESPECIAL KInterface2.test2
@@ -0,0 +1,26 @@
// !API_VERSION: 1.3
// !JVM_DEFAULT_MODE: compatibility
// JVM_TARGET: 1.8
// WITH_RUNTIME
interface KInterface {
@JvmDefault
var bar: String
get() = "OK"
set(field) {}
}
interface KInterface2 : KInterface {
}
// 1 INVOKESTATIC KInterface2.access\$getBar\$jd
// 1 INVOKESTATIC KInterface2.access\$setBar\$jd
// 1 INVOKESTATIC KInterface.access\$getBar\$jd
// 1 INVOKESTATIC KInterface.access\$setBar\$jd
// 1 INVOKESPECIAL KInterface2.getBar
// 1 INVOKESPECIAL KInterface2.setBar
// 1 INVOKESPECIAL KInterface.getBar
// 1 INVOKESPECIAL KInterface.setBar