From c748b6f3ee7ceb4f38a098fa5232157a1d89cfab Mon Sep 17 00:00:00 2001 From: Ilmir Usmanov Date: Mon, 17 Feb 2020 18:29:30 +0100 Subject: [PATCH] JVM_IR. Minor. Update bytecode text test to JVM_IR or create issues when this is not feasible. --- .../assert/jvmCrossinlineAssertInLambda.kt | 1 + .../bytecodeText/assert/jvmNestedClass.kt | 1 + .../debug/localVariableCorrectLabel.kt | 12 ++++++++---- .../coroutines/debug/thisAndResultInLvt.kt | 19 ++++++++++++++++++- .../coroutines/varValueConflictsWithTable.kt | 2 ++ .../varValueConflictsWithTableSameSort.kt | 2 ++ .../inline/inlineSuspendReifiedNoSpilling.kt | 4 ++-- 7 files changed, 34 insertions(+), 7 deletions(-) diff --git a/compiler/testData/codegen/bytecodeText/assert/jvmCrossinlineAssertInLambda.kt b/compiler/testData/codegen/bytecodeText/assert/jvmCrossinlineAssertInLambda.kt index 50890f3dd80..f855446ebb9 100644 --- a/compiler/testData/codegen/bytecodeText/assert/jvmCrossinlineAssertInLambda.kt +++ b/compiler/testData/codegen/bytecodeText/assert/jvmCrossinlineAssertInLambda.kt @@ -1,3 +1,4 @@ +// This test is ignored until KT-36794 is fixed // IGNORE_BACKEND: JVM // IGNORE_BACKEND: JVM_IR // KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm diff --git a/compiler/testData/codegen/bytecodeText/assert/jvmNestedClass.kt b/compiler/testData/codegen/bytecodeText/assert/jvmNestedClass.kt index eabadf9a17c..5ff14897cb5 100644 --- a/compiler/testData/codegen/bytecodeText/assert/jvmNestedClass.kt +++ b/compiler/testData/codegen/bytecodeText/assert/jvmNestedClass.kt @@ -1,3 +1,4 @@ +// This test is ignored until KT-36794 is fixed. // IGNORE_BACKEND: JVM // IGNORE_BACKEND: JVM_IR // KOTLIN_CONFIGURATION_FLAGS: ASSERTIONS_MODE=jvm diff --git a/compiler/testData/codegen/bytecodeText/coroutines/debug/localVariableCorrectLabel.kt b/compiler/testData/codegen/bytecodeText/coroutines/debug/localVariableCorrectLabel.kt index c42f30e1e80..0418149b071 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/debug/localVariableCorrectLabel.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/debug/localVariableCorrectLabel.kt @@ -14,8 +14,12 @@ fun main(args: Array) { @BuilderInference suspend fun SequenceScope.awaitSeq(): Int = 42 -// 1 LOCALVARIABLE a I L17 L.* 3 -// 1 LINENUMBER 8 L17 -// Adding ignore flags below the test since the test relies on line numbers. -// IGNORE_BACKEND: JVM_IR +// label numbers differ in BEs +// JVM_TEMPLATES +// 1 LOCALVARIABLE a I L17 L.* +// 1 LINENUMBER 8 L17 + +// JVM_IR_TEMPLATES +// 1 LOCALVARIABLE a I L14 L.* +// 1 LINENUMBER 8 L14 diff --git a/compiler/testData/codegen/bytecodeText/coroutines/debug/thisAndResultInLvt.kt b/compiler/testData/codegen/bytecodeText/coroutines/debug/thisAndResultInLvt.kt index bcd0e2626c0..ee21e549024 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/debug/thisAndResultInLvt.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/debug/thisAndResultInLvt.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND: JVM_IR suspend fun dummy() {} val c: suspend () -> Unit = { @@ -13,6 +12,10 @@ class A { } } +// BEs generate continuation classes differently, JVM_IR generates more correctly + +// JVM_TEMPLATES +// invokeSuspend // 1 LOCALVARIABLE this LThisAndResultInLvtKt\$c\$1; L0 L.* 0 // c's lambda and foo's continuation // 2 LOCALVARIABLE \$result Ljava/lang/Object; L0 L.* 1 @@ -23,3 +26,17 @@ class A { // 1 LOCALVARIABLE s Ljava/lang/String; L0 L.* 2 // 1 LOCALVARIABLE block Lkotlin/jvm/functions/Function2; L0 L.* 3 // 1 LOCALVARIABLE \$continuation Lkotlin/coroutines/Continuation; L2 L.* 6 + +// JVM_IR_TEMPLATES +// , invoke, invokeSuspend, create +// 4 LOCALVARIABLE this LThisAndResultInLvtKt\$c\$1; L0 L.* 0 +// TODO: Continuation are generated even for tail-call suspend functions: KT-36795 +// c's lambda and foo's and dummy's continuation +// 3 LOCALVARIABLE \$result Ljava/lang/Object; L0 L.* 1 + +// foo and +// 2 LOCALVARIABLE this LA; L0 L.* 0 +// 1 LOCALVARIABLE a LA; L0 L.* 1 +// 1 LOCALVARIABLE s Ljava/lang/String; L0 L.* 2 +// 1 LOCALVARIABLE block Lkotlin/jvm/functions/Function2; L0 L.* 3 +// 1 LOCALVARIABLE \$continuation Lkotlin/coroutines/Continuation; L2 L.* 6 \ No newline at end of file diff --git a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt index 6d5ee6a7b2e..1bb3178f1c9 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt @@ -1,3 +1,5 @@ +// This test checks, that different variables occupy the same slot +// In JVM_IR, however, loop variable's lifetime goes beyond the loop itself, thus the test has no sense in JVM_IR // IGNORE_BACKEND: JVM_IR // WITH_COROUTINES diff --git a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt index 260a1892833..605f7a4e54b 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt @@ -1,3 +1,5 @@ +// This test checks, that different variables occupy the same slot +// In JVM_IR, however, loop variable's lifetime goes beyond the loop itself, thus the test has no sense in JVM_IR // IGNORE_BACKEND: JVM_IR // WITH_COROUTINES diff --git a/compiler/testData/codegen/bytecodeText/inline/inlineSuspendReifiedNoSpilling.kt b/compiler/testData/codegen/bytecodeText/inline/inlineSuspendReifiedNoSpilling.kt index 4a4f9c1e48c..5ad5f42410d 100644 --- a/compiler/testData/codegen/bytecodeText/inline/inlineSuspendReifiedNoSpilling.kt +++ b/compiler/testData/codegen/bytecodeText/inline/inlineSuspendReifiedNoSpilling.kt @@ -1,6 +1,6 @@ +// $$forInline suffix is not needed: KT-36797 +// JVM_IR generates fake inliner variable with suffix $$forInline, when old BE does not do this // IGNORE_BACKEND: JVM_IR -// In JVM_IR $i$f variables occupy different slots - interface ApplicationCall interface AuthenticationService {