Remove LANGUAGE_VERSION from codegen tests on coroutines

Use `// !LANGUAGE: -ReleaseCoroutines` instead in tests which require
old (1.2) coroutines, and nothing in tests which require new coroutines
because master is already 1.3. Also remove superfluous API_VERSION and
other directives which have no effect anymore. Do not include runtime
automatically with `WITH_COROUTINES`/`COMMON_COROUTINES_TEST` in box
tests; require `WITH_RUNTIME` for that (majority of tests already had it
anyway), but remove it from bytecode text tests where runtime is always
added automatically. Fix the coroutine package selection code in
KotlinTestUtils and update the bunch files correspondingly.

Disable tests in `box/coroutines/noStdLib` on JVM: despite the name,
these tests were launched with stdlib because of the code in
CodegenTestCase, and they do not work without it because at least
CoroutineUtil.kt requires stdlib to compile correctly
This commit is contained in:
Alexander Udalov
2018-12-17 17:35:08 +01:00
parent 5b58eb8491
commit ec2dd58165
75 changed files with 173 additions and 324 deletions
+4 -2
View File
@@ -1,10 +1,12 @@
// LANGUAGE_VERSION: 1.2
// !LANGUAGE: -ReleaseCoroutines
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import helpers.*
import kotlin.coroutines.experimental.*
import kotlin.coroutines.experimental.intrinsics.*
suspend fun suspendHere() = ""
fun builder(c: suspend () -> Unit) {
@@ -1,7 +1,6 @@
// WITH_RUNTIME
// LANGUAGE_VERSION: 1.2
// IGNORE_BACKEND: JVM
// !LANGUAGE: -ReleaseCoroutines
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.experimental.*
import kotlin.coroutines.experimental.intrinsics.*
@@ -29,4 +28,4 @@ fun box(): String {
// Test for continuation of 'run' transformation.
// Since continuation is not suspend lambda, it should not have state-machine.
// @CrossinlineSuspendContinuation_1_2Kt$box$1$doResume$$inlined$inlineMe$1$1.class:
// 0 TABLESWITCH
// 0 TABLESWITCH
@@ -1,6 +1,5 @@
// WITH_RUNTIME
// LANGUAGE_VERSION: 1.3
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
@@ -28,4 +27,4 @@ fun box(): String {
// Test for continuation of 'run' transformation.
// Since continuation is not suspend lambda, it should not have state-machine
// @CrossinlineSuspendContinuation_1_3Kt$box$1$invokeSuspend$$inlined$inlineMe$1$1.class:
// 0 TABLESWITCH
// 0 TABLESWITCH
@@ -1,5 +1,3 @@
// LANGUAGE_VERSION: 1.3
suspend fun dummy() {}
suspend fun tailCall() {
@@ -1,5 +1,3 @@
// LANGUAGE_VERSION: 1.3
import kotlin.sequences.*
import kotlin.experimental.*
@@ -17,4 +15,4 @@ fun main(args: Array<String>) {
suspend fun SequenceScope<Int>.awaitSeq(): Int = 42
// 1 LOCALVARIABLE a I L19 L23 3
// 1 LINENUMBER 10 L19
// 1 LINENUMBER 8 L19
@@ -1,5 +1,3 @@
// LANGUAGE_VERSION: 1.3
// WITH_RUNTIME
// TREAT_AS_ONE_FILE
import kotlin.coroutines.intrinsics.*
@@ -14,4 +12,4 @@ suspend fun simpleReturn() = suspendCoroutineUninterceptedOrReturn<Int> { cont -
cont.resume(0)
}
// 2 INVOKESTATIC kotlin/coroutines/jvm/internal/DebugProbesKt.probeCoroutineSuspended
// 2 INVOKESTATIC kotlin/coroutines/jvm/internal/DebugProbesKt.probeCoroutineSuspended
@@ -1,5 +1,3 @@
// LANGUAGE_VERSION: 1.3
suspend fun dummy() {}
val c: suspend () -> Unit = {
@@ -21,4 +19,4 @@ class A {
// 1 LOCALVARIABLE a LA; L0 L21 1
// 1 LOCALVARIABLE s Ljava/lang/String; L0 L21 2
// 1 LOCALVARIABLE block Lkotlin/jvm/functions/Function2; L0 L21 3
// 1 LOCALVARIABLE \$continuation Lkotlin/coroutines/Continuation; L2 L7 6
// 1 LOCALVARIABLE \$continuation Lkotlin/coroutines/Continuation; L2 L7 6
@@ -1,6 +1,5 @@
// LANGUAGE_VERSION: 1.3
// WITH_RUNTIME
// TREAT_AS_ONE_FILE
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
@@ -1,6 +1,6 @@
// LANGUAGE_VERSION: 1.2
// WITH_RUNTIME
// !LANGUAGE: -ReleaseCoroutines
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import kotlin.coroutines.experimental.*
@@ -1,6 +1,5 @@
// LANGUAGE_VERSION: 1.3
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import kotlin.coroutines.*
@@ -1,6 +1,5 @@
// LANGUAGE_VERSION: 1.3
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import kotlin.coroutines.*
@@ -1,6 +1,6 @@
// LANGUAGE_VERSION: 1.2
// WITH_RUNTIME
// !LANGUAGE: -ReleaseCoroutines
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import kotlin.coroutines.experimental.*
@@ -1,6 +1,6 @@
// LANGUAGE_VERSION: 1.2
// WITH_RUNTIME
// !LANGUAGE: -ReleaseCoroutines
// WITH_COROUTINES
import helpers.*
// TREAT_AS_ONE_FILE
import kotlin.coroutines.experimental.*