diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/processUninitializedStores.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/processUninitializedStores.kt index 6856f7b03b6..78a48993d9a 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/processUninitializedStores.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/processUninitializedStores.kt @@ -82,13 +82,15 @@ class UninitializedStoresProcessor(private val methodNode: MethodNode) { private val isInSpecialMethod = methodNode.name == "" || methodNode.name == "" fun run() { - val interpreter = UninitializedNewValueMarkerInterpreter(methodNode.instructions) - if (methodNode.instructions.toArray().none { it.opcode == Opcodes.NEW }) return - val frames = CustomFramesMethodAnalyzer("fake", methodNode, interpreter, this::UninitializedNewValueFrame).analyze() - + val interpreter = UninitializedNewValueMarkerInterpreter(methodNode.instructions) + val analyzer = object : FastMethodAnalyzer("fake", methodNode, interpreter, pruneExceptionEdges = true) { + override fun newFrame(nLocals: Int, nStack: Int): Frame = + UninitializedNewValueFrame(nLocals, nStack) + } + val frames = analyzer.analyze() interpreter.analyzePopInstructions(frames) for ((index, insn) in methodNode.instructions.toArray().withIndex()) { diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/RedundantCheckCastElimination.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/RedundantCheckCastElimination.kt index 72d9ed4e9f1..9dd001af82d 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/RedundantCheckCastElimination.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/RedundantCheckCastElimination.kt @@ -17,6 +17,7 @@ package org.jetbrains.kotlin.codegen.optimization import org.jetbrains.kotlin.codegen.inline.ReifiedTypeInliner +import org.jetbrains.kotlin.codegen.optimization.common.FastMethodAnalyzer import org.jetbrains.kotlin.codegen.optimization.common.InstructionLivenessAnalyzer import org.jetbrains.kotlin.codegen.optimization.common.OptimizationBasicInterpreter import org.jetbrains.kotlin.codegen.optimization.fixStack.top @@ -49,22 +50,21 @@ class RedundantCheckCastEliminationMethodTransformer : MethodTransformer() { val redundantCheckCasts = ArrayList() - val frames = analyze(internalClassName, methodNode, interpreter) + val frames = FastMethodAnalyzer(internalClassName, methodNode, interpreter, pruneExceptionEdges = true).analyze() for (i in insns.indices) { val valueType = frames[i]?.top()?.type ?: continue val insn = insns[i] - if (insn is TypeInsnNode) { - val insnType = Type.getObjectType(insn.desc) + if (insn.opcode == Opcodes.CHECKCAST) { + val typeInsn = insn as TypeInsnNode + val insnType = Type.getObjectType(typeInsn.desc) if (!isTrivialSubtype(insnType, valueType)) continue //Keep casts to multiarray types cause dex doesn't recognize ANEWARRAY [Ljava/lang/Object; as Object [][], but Object [] type //It's not clear is it bug in dex or not and maybe best to distinguish such types from MULTINEWARRRAY ones in method analyzer if (isMultiArrayType(insnType)) continue - if (insn.opcode == Opcodes.CHECKCAST) { - redundantCheckCasts.add(insn) - } + redundantCheckCasts.add(typeInsn) } } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/common/CustomFramesMethodAnalyzer.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/common/CustomFramesMethodAnalyzer.kt deleted file mode 100644 index 83f9198e63a..00000000000 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/common/CustomFramesMethodAnalyzer.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2010-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.codegen.optimization.common - -import org.jetbrains.org.objectweb.asm.tree.MethodNode -import org.jetbrains.org.objectweb.asm.tree.analysis.Frame -import org.jetbrains.org.objectweb.asm.tree.analysis.Interpreter -import org.jetbrains.org.objectweb.asm.tree.analysis.Value - -class CustomFramesMethodAnalyzer( - owner: String, method: MethodNode, interpreter: Interpreter, - private val frameFactory: (Int, Int) -> Frame -) : FastMethodAnalyzer(owner, method, interpreter) { - override fun newFrame(nLocals: Int, nStack: Int) = frameFactory(nLocals, nStack) -} diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/common/FastMethodAnalyzer.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/common/FastMethodAnalyzer.kt index 651026cc1c9..a0cadeef3b7 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/common/FastMethodAnalyzer.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/optimization/common/FastMethodAnalyzer.kt @@ -47,10 +47,12 @@ import org.jetbrains.org.objectweb.asm.tree.analysis.Value * @see org.jetbrains.kotlin.codegen.optimization.fixStack.FastStackAnalyzer */ @Suppress("DuplicatedCode") -open class FastMethodAnalyzer( +open class FastMethodAnalyzer +@JvmOverloads constructor( private val owner: String, - val method: MethodNode, - private val interpreter: Interpreter + private val method: MethodNode, + private val interpreter: Interpreter, + private val pruneExceptionEdges: Boolean = false ) { private val insnsArray = method.instructions.toArray() private val nInsns = method.instructions.size() @@ -74,6 +76,11 @@ open class FastMethodAnalyzer( computeExceptionHandlersForEachInsn(method) initMergeNodes() + val isTcbStart = BooleanArray(nInsns) + for (tcb in method.tryCatchBlocks) { + isTcbStart[tcb.start.indexOf()] = true + } + val current = newFrame(method.maxLocals, method.maxStack) val handler = newFrame(method.maxLocals, method.maxStack) initLocals(current) @@ -107,14 +114,20 @@ open class FastMethodAnalyzer( } } - handlers[insn]?.forEach { tcb -> - val exnType = Type.getObjectType(tcb.type ?: "java/lang/Throwable") - val jump = tcb.handler.indexOf() + // Jump by an exception edge clears the stack, putting exception on top. + // So, unless we have a store operation, anything we change on stack would be lost, + // and there's no need to analyze exception handler again. + // Add an exception edge from TCB start to make sure handler itself is still visited. + if (!pruneExceptionEdges || insnOpcode in Opcodes.ISTORE..Opcodes.ASTORE || insnOpcode == Opcodes.IINC || isTcbStart[insn]) { + handlers[insn]?.forEach { tcb -> + val exnType = Type.getObjectType(tcb.type ?: "java/lang/Throwable") + val jump = tcb.handler.indexOf() - handler.init(f) - handler.clearStack() - handler.push(interpreter.newValue(exnType)) - mergeControlFlowEdge(jump, handler) + handler.init(f) + handler.clearStack() + handler.push(interpreter.newValue(exnType)) + mergeControlFlowEdge(jump, handler) + } } } catch (e: AnalyzerException) { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java index ae37e8d1063..d952b996abc 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirBlackBoxCodegenTestGenerated.java @@ -8787,12 +8787,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/controlStructures/quicksort.kt"); } - @Test - @TestMetadata("slowHtmlLikeDsl.kt") - public void testSlowHtmlLikeDsl() throws Exception { - runTest("compiler/testData/codegen/box/controlStructures/slowHtmlLikeDsl.kt"); - } - @Test @TestMetadata("tcbInEliminatedCondition.kt") public void testTcbInEliminatedCondition() throws Exception { @@ -9451,6 +9445,28 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT } } + @Nested + @TestMetadata("compiler/testData/codegen/box/controlStructures/slowDsl") + @TestDataPath("$PROJECT_ROOT") + public class SlowDsl { + @Test + public void testAllFilesPresentInSlowDsl() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/slowDsl"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("slowHtmlLikeDsl.kt") + public void testSlowHtmlLikeDsl() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDsl.kt"); + } + + @Test + @TestMetadata("slowHtmlLikeDslNoInline.kt") + public void testSlowHtmlLikeDslNoInline() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDslNoInline.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/testData/codegen/box/controlStructures/slowHtmlLikeDsl.kt b/compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDsl.kt similarity index 94% rename from compiler/testData/codegen/box/controlStructures/slowHtmlLikeDsl.kt rename to compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDsl.kt index c0d6a5d7872..0e113f62858 100644 --- a/compiler/testData/codegen/box/controlStructures/slowHtmlLikeDsl.kt +++ b/compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDsl.kt @@ -35,9 +35,13 @@ inline fun Builder.t2(body: Builder.() -> Unit) { val expectedLength = 1906 +fun doStuff(b: Builder) { + b.t2 { t2 { t2 { t2 { t2 { t2 { t2 { text("1") } } } } } } } +} + fun box(): String { val b = Builder("") - b.t2 { t2 { t2 { t2 { t2 { t2 { t2 { text("1") } } } } } } } + doStuff(b) if (b.content.length != expectedLength) return "${b.content.length}" else diff --git a/compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDslNoInline.kt b/compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDslNoInline.kt new file mode 100644 index 00000000000..e9461e5437b --- /dev/null +++ b/compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDslNoInline.kt @@ -0,0 +1,45 @@ +// TARGET_BACKEND: JVM +// ^ this test might be rather slow + +class Builder(var content: String) + +fun Builder.begin(t: String) { + content += "<$t>" +} + +fun Builder.text(t: String) { + content += t +} + +fun Builder.end(t: String) { + content += "" +} + +fun err(e: Throwable) {} + +fun Builder.tag(t: String, body: Builder.() -> Unit) { + begin(t) + try { + body() + } catch (e: Throwable) { + err(e) + } finally { + end(t) + } +} + +fun Builder.t2(body: Builder.() -> Unit) { + tag("t", body) + tag("t", body) +} + +val expectedLength = 1906 + +fun box(): String { + val b = Builder("") + b.t2 { t2 { t2 { t2 { t2 { t2 { t2 { text("1") } } } } } } } + if (b.content.length != expectedLength) + return "${b.content.length}" + else + return "OK" +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index 192f37c326a..959ad5b2988 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -8667,12 +8667,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/controlStructures/quicksort.kt"); } - @Test - @TestMetadata("slowHtmlLikeDsl.kt") - public void testSlowHtmlLikeDsl() throws Exception { - runTest("compiler/testData/codegen/box/controlStructures/slowHtmlLikeDsl.kt"); - } - @Test @TestMetadata("tcbInEliminatedCondition.kt") public void testTcbInEliminatedCondition() throws Exception { @@ -9331,6 +9325,28 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/controlStructures/slowDsl") + @TestDataPath("$PROJECT_ROOT") + public class SlowDsl { + @Test + public void testAllFilesPresentInSlowDsl() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/slowDsl"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @Test + @TestMetadata("slowHtmlLikeDsl.kt") + public void testSlowHtmlLikeDsl() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDsl.kt"); + } + + @Test + @TestMetadata("slowHtmlLikeDslNoInline.kt") + public void testSlowHtmlLikeDslNoInline() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDslNoInline.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index c48e569f957..7237c91c250 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -8787,12 +8787,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/controlStructures/quicksort.kt"); } - @Test - @TestMetadata("slowHtmlLikeDsl.kt") - public void testSlowHtmlLikeDsl() throws Exception { - runTest("compiler/testData/codegen/box/controlStructures/slowHtmlLikeDsl.kt"); - } - @Test @TestMetadata("tcbInEliminatedCondition.kt") public void testTcbInEliminatedCondition() throws Exception { @@ -9451,6 +9445,28 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes } } + @Nested + @TestMetadata("compiler/testData/codegen/box/controlStructures/slowDsl") + @TestDataPath("$PROJECT_ROOT") + public class SlowDsl { + @Test + public void testAllFilesPresentInSlowDsl() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/slowDsl"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("slowHtmlLikeDsl.kt") + public void testSlowHtmlLikeDsl() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDsl.kt"); + } + + @Test + @TestMetadata("slowHtmlLikeDslNoInline.kt") + public void testSlowHtmlLikeDslNoInline() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDslNoInline.kt"); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions") @TestDataPath("$PROJECT_ROOT") diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 4dc549974f7..4265592878f 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -6698,11 +6698,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/controlStructures/quicksort.kt"); } - @TestMetadata("slowHtmlLikeDsl.kt") - public void testSlowHtmlLikeDsl() throws Exception { - runTest("compiler/testData/codegen/box/controlStructures/slowHtmlLikeDsl.kt"); - } - @TestMetadata("tcbInEliminatedCondition.kt") public void testTcbInEliminatedCondition() throws Exception { runTest("compiler/testData/codegen/box/controlStructures/tcbInEliminatedCondition.kt"); @@ -7284,6 +7279,29 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes } } + @TestMetadata("compiler/testData/codegen/box/controlStructures/slowDsl") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class SlowDsl extends AbstractLightAnalysisModeTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); + } + + public void testAllFilesPresentInSlowDsl() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/slowDsl"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); + } + + @TestMetadata("slowHtmlLikeDsl.kt") + public void testSlowHtmlLikeDsl() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDsl.kt"); + } + + @TestMetadata("slowHtmlLikeDslNoInline.kt") + public void testSlowHtmlLikeDslNoInline() throws Exception { + runTest("compiler/testData/codegen/box/controlStructures/slowDsl/slowHtmlLikeDslNoInline.kt"); + } + } + @TestMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java index 81ddf821317..839b74d522e 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java @@ -6525,6 +6525,16 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/controlStructures/slowDsl") + @TestDataPath("$PROJECT_ROOT") + public class SlowDsl { + @Test + public void testAllFilesPresentInSlowDsl() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/slowDsl"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index 4cacaf0d9da..f956aaca8be 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -6567,6 +6567,16 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { } } + @Nested + @TestMetadata("compiler/testData/codegen/box/controlStructures/slowDsl") + @TestDataPath("$PROJECT_ROOT") + public class SlowDsl { + @Test + public void testAllFilesPresentInSlowDsl() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/slowDsl"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java index 3d6385db400..61b4a6f3374 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/testOld/wasm/semantics/IrCodegenBoxWasmTestGenerated.java @@ -5691,6 +5691,19 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest } } + @TestMetadata("compiler/testData/codegen/box/controlStructures/slowDsl") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class SlowDsl extends AbstractIrCodegenBoxWasmTest { + private void runTest(String testDataFilePath) throws Exception { + KotlinTestUtils.runTest0(this::doTest, TargetBackend.WASM, testDataFilePath); + } + + public void testAllFilesPresentInSlowDsl() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/slowDsl"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true); + } + } + @TestMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java index 5a70240a8b3..2f0b9cd1ffd 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java @@ -7369,6 +7369,18 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest } } + @Nested + @TestMetadata("compiler/testData/codegen/box/controlStructures/slowDsl") + @TestDataPath("$PROJECT_ROOT") + @Tag("codegen") + @UseExtTestCaseGroupProvider() + public class SlowDsl { + @Test + public void testAllFilesPresentInSlowDsl() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/controlStructures/slowDsl"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true); + } + } + @Nested @TestMetadata("compiler/testData/codegen/box/controlStructures/tryCatchInExpressions") @TestDataPath("$PROJECT_ROOT")