From 0b9b1b6945a3ceffb933d7f2afdc1b57059099b1 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Tue, 18 Feb 2020 18:00:58 +0300 Subject: [PATCH] Update bytecode text tests for JVM_IR --- .../intrinsicsCompare/byteSmartCast_after.kt | 11 +++++++- .../intrinsicsCompare/byteSmartCast_before.kt | 11 +++++++- .../intrinsicsCompare/intSmartCast_before.kt | 11 +++++++- .../intrinsicsCompare/shortSmartCast_after.kt | 11 +++++++- .../shortSmartCast_before.kt | 12 ++++++-- .../jackAndJill/inlineDefaultBodyInClass.kt | 17 ----------- .../jackAndJill/inlinedConstuctor.kt | 11 -------- .../inlinedConstuctorWithSuperCallParams.kt | 18 ------------ .../localInitializationLVT/boxing.kt | 2 ++ .../localInitializationLVT/contract.kt | 2 +- .../localInitializationLVT/contractVar.kt | 8 ++++-- .../localInitializationLVT/ifStatement.kt | 1 + .../localInitializationLVT/ifStatementVar.kt | 1 + .../ifStatementWithoutBlock.kt | 1 + .../ifStatementWithoutBlockVar.kt | 1 + .../localInitializationLVT/inlineClass.kt | 2 ++ .../localInitializationLVT/inlineClassVar.kt | 2 ++ .../localInitializationLVT/lateinit.kt | 2 ++ .../localInitializationLVT/run.kt | 2 ++ .../localInitializationLVT/singleBlock.kt | 1 + .../localInitializationLVT/singleBlockVar.kt | 1 + .../localInitializationLVT/whenStatement.kt | 1 + .../whenStatementVar.kt | 1 + .../expressionValueIsNotNull.kt | 1 + .../expressionValueIsNotNullTwice.kt | 1 + .../localLateinit/checkedOnce.kt | 1 + .../localLateinit/initialized.kt | 1 + .../notNullExpressionValueTwice_1_4.kt | 1 + .../definedInSources.kt | 1 + .../inSeparateModule.kt | 1 + .../optimizedDelegatedProperties/lazy.kt | 1 + .../withNonNullMetadataParameter.kt | 1 + .../properties/lateinit/companionObject.kt | 6 +++- .../codegen/BytecodeTextTestGenerated.java | 28 ------------------- .../ir/IrBytecodeTextTestGenerated.java | 28 ------------------- 35 files changed, 89 insertions(+), 112 deletions(-) delete mode 100644 compiler/testData/codegen/bytecodeText/jackAndJill/inlineDefaultBodyInClass.kt delete mode 100644 compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctor.kt delete mode 100644 compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctorWithSuperCallParams.kt diff --git a/compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_after.kt b/compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_after.kt index cd1d063bb48..49f6718c343 100644 --- a/compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_after.kt +++ b/compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_after.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND: JVM_IR fun equals3(a: Byte?, b: Byte?) = a != null && b != null && a == b fun equals4(a: Byte?, b: Byte?) = if (a is Byte && b is Byte) a == b else null!! @@ -12,7 +11,17 @@ fun less4(a: Byte?, b: Byte?) = if (a is Byte && b is Byte) a < b else true fun less5(a: Any?, b: Any?) = if (a is Byte && b is Byte) a < b else true +// JVM_TEMPLATES // 3 Intrinsics\.areEqual // 0 Intrinsics\.compare // 0 IFGE // 3 IF_ICMPGE + +// JVM_IR_TEMPLATES +// 0 Intrinsics\.areEqual +// 0 Intrinsics\.compare +// 8 INVOKEVIRTUAL java/lang/Byte\.byteValue \(\)B +// 4 INVOKEVIRTUAL java/lang/Number\.byteValue \(\)B +// 0 IFGE +// 3 IF_ICMPNE +// 3 IF_ICMPGE diff --git a/compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_before.kt b/compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_before.kt index fa7d89ac58f..a70dc5d717a 100644 --- a/compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_before.kt +++ b/compiler/testData/codegen/bytecodeText/intrinsicsCompare/byteSmartCast_before.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProperIeee754Comparisons -// IGNORE_BACKEND: JVM_IR fun equals3(a: Byte?, b: Byte?) = a != null && b != null && a == b fun equals4(a: Byte?, b: Byte?) = if (a is Byte && b is Byte) a == b else null!! @@ -12,8 +11,18 @@ fun less4(a: Byte?, b: Byte?) = if (a is Byte && b is Byte) a < b else true fun less5(a: Any?, b: Any?) = if (a is Byte && b is Byte) a < b else true +// JVM_TEMPLATES // 3 Intrinsics\.areEqual // 3 Intrinsics\.compare // for compare: // 3 IFGE // 0 IF_ICMPGE + +// JVM_IR_TEMPLATES +// 0 Intrinsics\.areEqual +// 0 Intrinsics\.compare +// 8 INVOKEVIRTUAL java/lang/Byte\.byteValue \(\)B +// 4 INVOKEVIRTUAL java/lang/Number\.byteValue \(\)B +// 0 IFGE +// 3 IF_ICMPGE +// 3 IF_ICMPNE \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/intrinsicsCompare/intSmartCast_before.kt b/compiler/testData/codegen/bytecodeText/intrinsicsCompare/intSmartCast_before.kt index e0d41de4841..f10cde20209 100644 --- a/compiler/testData/codegen/bytecodeText/intrinsicsCompare/intSmartCast_before.kt +++ b/compiler/testData/codegen/bytecodeText/intrinsicsCompare/intSmartCast_before.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProperIeee754Comparisons -// IGNORE_BACKEND: JVM_IR fun equals3(a: Int?, b: Int?) = a != null && b != null && a == b fun equals4(a: Int?, b: Int?) = if (a is Int && b is Int) a == b else null!! @@ -12,8 +11,18 @@ fun less4(a: Int?, b: Int?) = if (a is Int && b is Int) a < b else true fun less5(a: Any?, b: Any?) = if (a is Int && b is Int) a < b else true +// JVM_TEMPLATES // 3 Intrinsics\.areEqual // 3 Intrinsics\.compare // for compare: // 3 IFGE // 0 IF_ICMPGE + +// JVM_IR_TEMPLATES +// 3 Intrinsics\.areEqual +// 0 Intrinsics\.compare +// 4 INVOKEVIRTUAL java/lang/Integer\.intValue \(\) +// 2 INVOKEVIRTUAL java/lang/Number\.intValue \(\)I +// 0 IFGE +// 3 IF_ICMPGE +// 0 IF_ICMPNE \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_after.kt b/compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_after.kt index d0d6022b283..2a16f59605b 100644 --- a/compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_after.kt +++ b/compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_after.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperIeee754Comparisons -// IGNORE_BACKEND: JVM_IR fun equals3(a: Short?, b: Short?) = a != null && b != null && a == b fun equals4(a: Short?, b: Short?) = if (a is Short && b is Short) a == b else null!! @@ -12,7 +11,17 @@ fun less4(a: Short?, b: Short?) = if (a is Short && b is Short) a < b else true fun less5(a: Any?, b: Any?) = if (a is Short && b is Short) a < b else true +// JVM_TEMPLATES // 3 Intrinsics\.areEqual // 0 Intrinsics\.compare // 0 IFGE // 3 IF_ICMPGE + +// JVM_IR_TEMPLATES +// 0 Intrinsics\.areEqual +// 0 Intrinsics\.compare +// 8 INVOKEVIRTUAL java/lang/Short\.shortValue \(\)S +// 4 INVOKEVIRTUAL java/lang/Number\.shortValue \(\)S +// 0 IFGE +// 3 IF_ICMPGE +// 3 IF_ICMPNE diff --git a/compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_before.kt b/compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_before.kt index 7810d0cb0a7..c63cfc86545 100644 --- a/compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_before.kt +++ b/compiler/testData/codegen/bytecodeText/intrinsicsCompare/shortSmartCast_before.kt @@ -1,5 +1,4 @@ // !LANGUAGE: -ProperIeee754Comparisons -// IGNORE_BACKEND: JVM_IR fun equals3(a: Short?, b: Short?) = a != null && b != null && a == b fun equals4(a: Short?, b: Short?) = if (a is Short && b is Short) a == b else null!! @@ -12,8 +11,17 @@ fun less4(a: Short?, b: Short?) = if (a is Short && b is Short) a < b else true fun less5(a: Any?, b: Any?) = if (a is Short && b is Short) a < b else true +// JVM_TEMPLATES // 3 Intrinsics\.areEqual // 3 Intrinsics\.compare -// for compare: // 3 IFGE // 0 IF_ICMPGE + +// JVM_IR_TEMPLATES +// 0 Intrinsics\.areEqual +// 0 Intrinsics\.compare +// 8 INVOKEVIRTUAL java/lang/Short\.shortValue \(\)S +// 4 INVOKEVIRTUAL java/lang/Number\.shortValue \(\)S +// 0 IFGE +// 3 IF_ICMPGE +// 3 IF_ICMPNE \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/jackAndJill/inlineDefaultBodyInClass.kt b/compiler/testData/codegen/bytecodeText/jackAndJill/inlineDefaultBodyInClass.kt deleted file mode 100644 index 89dd5da7bfd..00000000000 --- a/compiler/testData/codegen/bytecodeText/jackAndJill/inlineDefaultBodyInClass.kt +++ /dev/null @@ -1,17 +0,0 @@ -// IGNORE_BACKEND: JVM_IR -open class A { - inline fun test(a: Int = 1, b: Long = 1L, c: String = "123") { - val d = 1 - } -} - -// -// 1 test\$default\(LA;IJLjava/lang/String;ILjava/lang/Object;\)V\s+L0 -// 1 LOCALVARIABLE this LA; L0 L9 0 -// 1 LOCALVARIABLE a I L0 L9 1 -// 1 LOCALVARIABLE b J L0 L9 2 -// 1 LOCALVARIABLE c Ljava/lang/String; L0 L9 4 -// 1 LOCALVARIABLE \$i\$f\$test I L6 L9 5 -// 1 LOCALVARIABLE d I L8 L9 6 - - diff --git a/compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctor.kt b/compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctor.kt deleted file mode 100644 index 990ca4a56ec..00000000000 --- a/compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctor.kt +++ /dev/null @@ -1,11 +0,0 @@ -// IGNORE_BACKEND: JVM_IR -public inline fun Iterable(crossinline iterator: () -> Iterator): Iterable = object : Iterable { - override fun iterator(): Iterator = iterator() -} - -public fun IntArray.asIterable(): Iterable { - return Iterable { this.iterator() } -} -/*Threre are two constuctors so we should be sure that we check required one by checking 'receiver$0$inlined' assign*/ -// 1 \(\[I\)V\s+L0\s+ALOAD 0\s+ALOAD 1\s+PUTFIELD InlinedConstuctorKt\$asIterable\$\$inlined\$Iterable\$1\.\$this_asIterable\$inlined : \[I -// 1 LOCALVARIABLE this LInlinedConstuctorKt\$asIterable\$\$inlined\$Iterable\$1; L0 L2 0 \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctorWithSuperCallParams.kt b/compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctorWithSuperCallParams.kt deleted file mode 100644 index 646a093bd04..00000000000 --- a/compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctorWithSuperCallParams.kt +++ /dev/null @@ -1,18 +0,0 @@ -// IGNORE_BACKEND: JVM_IR -open class A(val z: String) { - -} - -inline fun test(crossinline s: () -> String) { - object : A("123") { - val x = s(); - } -} - -fun main(args: Array) { - var z = "123"; - test { z } -} - -/*Threre are two constuctors so we should be sure that we check LOCALVARIABLEs from same method*/ -// 1 LOCALVARIABLE this LInlinedConstuctorWithSuperCallParamsKt\$main\$\$inlined\$test\$1; L0 L8 0\s+LOCALVARIABLE \$super_call_param\$1 Ljava/lang/String; L0 L8 1 diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/boxing.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/boxing.kt index 41d3f82e3f5..0371c0b9117 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/boxing.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/boxing.kt @@ -1,4 +1,6 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36648 Captured variables not optimized in JVM_IR +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR fun test(): java.lang.Integer { val c: java.lang.Integer diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/contract.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/contract.kt index 29e3d3f3e4b..87990ea3826 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/contract.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/contract.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND: JVM_IR - +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR import kotlin.contracts.ExperimentalContracts import kotlin.contracts.InvocationKind import kotlin.contracts.contract diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/contractVar.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/contractVar.kt index 528bc393c6b..6c6a7500409 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/contractVar.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/contractVar.kt @@ -1,5 +1,5 @@ // IGNORE_BACKEND: JVM_IR - +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR import kotlin.contracts.ExperimentalContracts import kotlin.contracts.InvocationKind import kotlin.contracts.contract @@ -22,4 +22,8 @@ fun doIt(block: () -> Unit) { } // 0 ISTORE 0 -// 1 LOCALVARIABLE c Lkotlin/jvm/internal/Ref\$CharRef; L1 L3 0 \ No newline at end of file +// 1 LOCALVARIABLE c Lkotlin/jvm/internal/Ref\$CharRef; L1 L3 0 + +// JVM_IR_TEMPLATES +// 0 ISTORE 0 +// 1 LOCALVARIABLE c Lkotlin/jvm/internal/Ref\$CharRef; L1 L4 0 \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatement.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatement.kt index 4ed08dd034a..fb1b7c36f3b 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatement.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatement.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR import kotlin.random.Random diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementVar.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementVar.kt index e718f6fcf16..bbc27b6e4e1 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementVar.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementVar.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR import kotlin.random.Random diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlock.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlock.kt index bea5d19239d..51957ea1223 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlock.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlock.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR import kotlin.random.Random diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlockVar.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlockVar.kt index e9f964995e6..743d70e8e25 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlockVar.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlockVar.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR import kotlin.random.Random diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClass.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClass.kt index 9c7c11e89ad..458db7b57ae 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClass.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClass.kt @@ -1,4 +1,6 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36648 Captured variables not optimized in JVM_IR +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR fun test(): UInt { val c: UInt diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClassVar.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClassVar.kt index 965edbe85f4..f7b3f124673 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClassVar.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClassVar.kt @@ -1,4 +1,6 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36648 Captured variables not optimized in JVM_IR +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR fun test(): UInt { var c: UInt diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/lateinit.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/lateinit.kt index 4cf3eafe28f..fa2f7761854 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/lateinit.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/lateinit.kt @@ -1,4 +1,6 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36648 Captured variables not optimized in JVM_IR +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR fun test(): Char { lateinit var c: Any diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/run.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/run.kt index 4a2d2cf704f..a2f326930d6 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/run.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/run.kt @@ -1,4 +1,6 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36648 Captured variables not optimized in JVM_IR +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR fun test(): Char { val c: Char diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlock.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlock.kt index f194e3b83e8..51d0a942ecd 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlock.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlock.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR fun test(): Char { val c: Char diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlockVar.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlockVar.kt index d97dd063053..f8cb104d580 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlockVar.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlockVar.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR fun test(): Char { var c: Char diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatement.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatement.kt index b639c206434..0594dc127c9 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatement.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatement.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR fun test(i: Int): Char { val c: Char diff --git a/compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatementVar.kt b/compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatementVar.kt index 4aedae6d4fd..60e002b106c 100644 --- a/compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatementVar.kt +++ b/compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatementVar.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36812 Generate proper lifetime intervals for local variables in JVM_IR fun test(i: Int): Char { var c: Char diff --git a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNull.kt b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNull.kt index 035d9a5a4f7..72554570669 100644 --- a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNull.kt +++ b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNull.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36813 Support code generated by JVM_IR in redundant null check optimization // FILE: j/J.java package j; diff --git a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNullTwice.kt b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNullTwice.kt index 1b74a7fae1e..d1140e00437 100644 --- a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNullTwice.kt +++ b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/expressionValueIsNotNullTwice.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36813 Support code generated by JVM_IR in redundant null check optimization // FILE: j/J.java package j; diff --git a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/checkedOnce.kt b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/checkedOnce.kt index 423351fb3d2..191ef119ebe 100644 --- a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/checkedOnce.kt +++ b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/checkedOnce.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36813 Support code generated by JVM_IR in redundant null check optimization fun almostAlwaysTrue() = true fun test() { diff --git a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/initialized.kt b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/initialized.kt index 4281c646167..0c7a4b266c8 100644 --- a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/initialized.kt +++ b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/localLateinit/initialized.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36813 Support code generated by JVM_IR in redundant null check optimization fun test() { lateinit var z: String run { diff --git a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/notNullExpressionValueTwice_1_4.kt b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/notNullExpressionValueTwice_1_4.kt index 7daa421d473..e4af280eb96 100644 --- a/compiler/testData/codegen/bytecodeText/nullCheckOptimization/notNullExpressionValueTwice_1_4.kt +++ b/compiler/testData/codegen/bytecodeText/nullCheckOptimization/notNullExpressionValueTwice_1_4.kt @@ -1,5 +1,6 @@ // !API_VERSION: LATEST // IGNORE_BACKEND: JVM_IR +// TODO KT-36813 Support code generated by JVM_IR in redundant null check optimization // FILE: j/J.java package j; diff --git a/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/definedInSources.kt b/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/definedInSources.kt index 9fd18f214c4..f74a254a16b 100644 --- a/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/definedInSources.kt +++ b/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/definedInSources.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36814 Support optimized delegated properties in JVM_IR class Provider(val _value: T) { inline operator fun provideDelegate(thisRef: Any?, kProperty: Any?) = diff --git a/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/inSeparateModule.kt b/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/inSeparateModule.kt index 7e1baf51cff..3d6d78b99f3 100644 --- a/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/inSeparateModule.kt +++ b/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/inSeparateModule.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36814 Support optimized delegated properties in JVM_IR // MODULE: lib // FILE: lib.kt diff --git a/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/lazy.kt b/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/lazy.kt index 06e0b33c9dc..7275121f222 100644 --- a/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/lazy.kt +++ b/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/lazy.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36814 Support optimized delegated properties in JVM_IR // WITH_RUNTIME val topLevelLazyVal by lazy { 1 } diff --git a/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/withNonNullMetadataParameter.kt b/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/withNonNullMetadataParameter.kt index 674142655cf..9203f03b0d2 100644 --- a/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/withNonNullMetadataParameter.kt +++ b/compiler/testData/codegen/bytecodeText/optimizedDelegatedProperties/withNonNullMetadataParameter.kt @@ -1,4 +1,5 @@ // IGNORE_BACKEND: JVM_IR +// TODO KT-36814 Support optimized delegated properties in JVM_IR class Provider(val _value: T) { inline operator fun provideDelegate(thisRef: Any?, kProperty: Any) = diff --git a/compiler/testData/codegen/bytecodeText/properties/lateinit/companionObject.kt b/compiler/testData/codegen/bytecodeText/properties/lateinit/companionObject.kt index 2e204a18dcb..ccc1bc351d0 100644 --- a/compiler/testData/codegen/bytecodeText/properties/lateinit/companionObject.kt +++ b/compiler/testData/codegen/bytecodeText/properties/lateinit/companionObject.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR class Foo { private companion object { lateinit var x: String @@ -21,5 +20,10 @@ class Foo { fun consume(s: String) {} +// JVM_TEMPLATES // There's 1 assertion in Foo.Companion.getX, and 4 in Foo.test2 (see KT-28331) // 5 throwUninitializedPropertyAccessException + +// JVM_IR_TEMPLATES +// JVM_IR invokes getX() (as suggested in KT-28331) +// 1 throwUninitializedPropertyAccessException diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java index 1b7fbbbf5a4..c78b24f070d 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java @@ -3053,34 +3053,6 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { } } - @TestMetadata("compiler/testData/codegen/bytecodeText/jackAndJill") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class JackAndJill extends AbstractBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInJackAndJill() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jackAndJill"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("inlineDefaultBodyInClass.kt") - public void testInlineDefaultBodyInClass() throws Exception { - runTest("compiler/testData/codegen/bytecodeText/jackAndJill/inlineDefaultBodyInClass.kt"); - } - - @TestMetadata("inlinedConstuctor.kt") - public void testInlinedConstuctor() throws Exception { - runTest("compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctor.kt"); - } - - @TestMetadata("inlinedConstuctorWithSuperCallParams.kt") - public void testInlinedConstuctorWithSuperCallParams() throws Exception { - runTest("compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctorWithSuperCallParams.kt"); - } - } - @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java index f85a0197158..d8b8339682d 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBytecodeTextTestGenerated.java @@ -3098,34 +3098,6 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest { } } - @TestMetadata("compiler/testData/codegen/bytecodeText/jackAndJill") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class JackAndJill extends AbstractIrBytecodeTextTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath); - } - - public void testAllFilesPresentInJackAndJill() throws Exception { - KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/bytecodeText/jackAndJill"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); - } - - @TestMetadata("inlineDefaultBodyInClass.kt") - public void testInlineDefaultBodyInClass() throws Exception { - runTest("compiler/testData/codegen/bytecodeText/jackAndJill/inlineDefaultBodyInClass.kt"); - } - - @TestMetadata("inlinedConstuctor.kt") - public void testInlinedConstuctor() throws Exception { - runTest("compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctor.kt"); - } - - @TestMetadata("inlinedConstuctorWithSuperCallParams.kt") - public void testInlinedConstuctorWithSuperCallParams() throws Exception { - runTest("compiler/testData/codegen/bytecodeText/jackAndJill/inlinedConstuctorWithSuperCallParams.kt"); - } - } - @TestMetadata("compiler/testData/codegen/bytecodeText/jvm8") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)