diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java index 32d776818cd..70253a576db 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java @@ -185,9 +185,16 @@ public class ClassFileFactory implements OutputFileCollection { @NotNull @TestOnly public String createText() { + return createText(null); + } + + @NotNull + @TestOnly + public String createText(@Nullable String ignorePrefixPath) { StringBuilder answer = new StringBuilder(); for (OutputFile file : asList()) { + if (ignorePrefixPath != null && file.getRelativePath().startsWith(ignorePrefixPath)) continue; File relativePath = new File(file.getRelativePath()); answer.append("@").append(relativePath).append('\n'); switch (FilesKt.getExtension(relativePath)) { diff --git a/compiler/testData/codegen/bytecodeText/constCoroutine.kt b/compiler/testData/codegen/bytecodeText/constCoroutine.kt index 5296a11ea51..7eaffcbaf17 100644 --- a/compiler/testData/codegen/bytecodeText/constCoroutine.kt +++ b/compiler/testData/codegen/bytecodeText/constCoroutine.kt @@ -24,5 +24,4 @@ fun box(): String { // 2 GETSTATIC kotlin/Unit.INSTANCE // 1 GETSTATIC helpers/EmptyContinuation.Companion -// 4 GETSTATIC kotlin\/coroutines\/experimental\/EmptyCoroutineContext.INSTANCE -// 7 GETSTATIC +// 3 GETSTATIC diff --git a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt index 796c4e33fe9..c83cc168069 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTable.kt @@ -1,10 +1,10 @@ +// LANGUAGE_VERSION: 1.3 // WITH_RUNTIME -// COMMON_COROUTINES_TEST // WITH_COROUTINES import helpers.* // TREAT_AS_ONE_FILE -import COROUTINES_PACKAGE.* -import COROUTINES_PACKAGE.intrinsics.* +import kotlin.coroutines.* +import kotlin.coroutines.intrinsics.* suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> x.resume("OK") } @@ -42,8 +42,8 @@ fun box(): String { return result } -// 1 LOCALVARIABLE i I L.* 3 -// 1 LOCALVARIABLE s Ljava/lang/String; L.* 3 +// 1 LOCALVARIABLE i I L.* 2 +// 1 LOCALVARIABLE s Ljava/lang/String; L.* 2 // 0 PUTFIELD VarValueConflictsWithTableKt\$box\$1.I\$0 : I /* 2 loads in cycle */ -// 2 ILOAD 3 \ No newline at end of file +// 2 ILOAD 2 diff --git a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt index 3a264dd4af9..c900fd580b4 100644 --- a/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt +++ b/compiler/testData/codegen/bytecodeText/coroutines/varValueConflictsWithTableSameSort.kt @@ -1,13 +1,11 @@ +// LANGUAGE_VERSION: 1.3 // WITH_RUNTIME -// COMMON_COROUTINES_TEST // WITH_COROUTINES import helpers.* // TREAT_AS_ONE_FILE -import COROUTINES_PACKAGE.* -import COROUTINES_PACKAGE.intrinsics.* -suspend fun suspendHere(): String = suspendCoroutineOrReturn { x -> - x.resume("OK") -} +import kotlin.coroutines.* +import kotlin.coroutines.intrinsics.* +suspend fun suspendHere(): String = "" fun builder(c: suspend () -> Unit) { c.startCoroutine(EmptyContinuation) @@ -17,6 +15,7 @@ fun box(): String { var result = "fail 1" builder { + var shiftSlot: String = "" // Initialize var with Int value try { var i: String = "abc" diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeTextTest.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeTextTest.kt index 1c203d3b5cf..4cda4b8488c 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeTextTest.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractBytecodeTextTest.kt @@ -29,7 +29,7 @@ abstract class AbstractBytecodeTextTest : CodegenTestCase() { } else { val expected = readExpectedOccurrences(wholeFile.path) - val actual = generateToText() + val actual = generateToText("helpers/") checkGeneratedTextAgainstExpectedOccurrences(actual, expected) } } diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java index 483ce03d52d..344c10afdc4 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/CodegenTestCase.java @@ -480,10 +480,15 @@ public abstract class CodegenTestCase extends KtUsefulTestCase { @NotNull protected String generateToText() { + return generateToText(null); + } + + @NotNull + protected String generateToText(@Nullable String ignorePathPrefix) { if (classFileFactory == null) { classFileFactory = generateFiles(myEnvironment, myFiles); } - return classFileFactory.createText(); + return classFileFactory.createText(ignorePathPrefix); } @NotNull