Add codegen tests with substituted bytecode version (1.8->1.9)

This commit is contained in:
Mikhael Bogdanov
2017-04-17 10:37:45 +02:00
parent b11e33901b
commit 46cdf0215e
2 changed files with 34 additions and 4 deletions
@@ -23,11 +23,13 @@ enum class JvmTarget(override val description: String) : TargetPlatformVersion {
JVM_1_8("1.8"),
;
val bytecodeVersion: Int
get() = when(this) {
val bytecodeVersion: Int by lazy {
when (this) {
JVM_1_6 -> Opcodes.V1_6
JVM_1_8 -> Opcodes.V1_8
JVM_1_8 ->
if (java.lang.Boolean.valueOf(System.getProperty("kotlin.test.substitute.bytecode.1.8.to.1.9"))) Opcodes.V1_9 else Opcodes.V1_8
}
}
companion object {
@JvmField
@@ -40,7 +42,7 @@ enum class JvmTarget(override val description: String) : TargetPlatformVersion {
val platformDescription = values().find { it.bytecodeVersion == bytecodeVersion }?.description ?:
when (bytecodeVersion) {
Opcodes.V1_7 -> "1.7"
Opcodes.V1_8 + 1 -> "1.9"
Opcodes.V1_9 -> "1.9"
else -> null
}