diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index 564d1f55c7d..90a501eabad 100644 --- a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -31997,6 +31997,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT runTest("compiler/testData/codegen/box/when/sealedWhenInitialization.kt"); } + @TestMetadata("switchBreakNoLabel.kt") + public void testSwitchBreakNoLabel() throws Exception { + runTest("compiler/testData/codegen/box/when/switchBreakNoLabel.kt"); + } + @TestMetadata("switchOptimizationDense.kt") public void testSwitchOptimizationDense() throws Exception { runTest("compiler/testData/codegen/box/when/switchOptimizationDense.kt"); diff --git a/compiler/testData/codegen/box/when/switchBreakNoLabel.kt b/compiler/testData/codegen/box/when/switchBreakNoLabel.kt new file mode 100644 index 00000000000..9b2cdb83250 --- /dev/null +++ b/compiler/testData/codegen/box/when/switchBreakNoLabel.kt @@ -0,0 +1,35 @@ +// IGNORE_BACKEND: JS +fun test(): Boolean { + var flagOuter = false + var flagInner = false + for (i in 0..5) { + when (i) { + 1 -> Unit + 2 -> Unit + 3 -> { + for (j in 0..5) { + when (j) { + 1 -> Unit + 2 -> { + flagInner = true + break + } + else -> flagInner = false + } + } + } + 4 -> { + flagOuter = true + break + } + else -> flagOuter = false + } + } + + return flagOuter and flagInner +} + +fun box(): String { + val flag = test() + return if (flag) "OK" else "fail1" +} \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index ff3e51b46c2..8c4df7b3c65 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -33768,6 +33768,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/when/sealedWhenInitialization.kt"); } + @TestMetadata("switchBreakNoLabel.kt") + public void testSwitchBreakNoLabel() throws Exception { + runTest("compiler/testData/codegen/box/when/switchBreakNoLabel.kt"); + } + @TestMetadata("switchOptimizationDense.kt") public void testSwitchOptimizationDense() throws Exception { runTest("compiler/testData/codegen/box/when/switchOptimizationDense.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 78a9f591916..a672f6193aa 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -31402,6 +31402,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/when/sealedWhenInitialization.kt"); } + @TestMetadata("switchBreakNoLabel.kt") + public void testSwitchBreakNoLabel() throws Exception { + runTest("compiler/testData/codegen/box/when/switchBreakNoLabel.kt"); + } + @TestMetadata("switchOptimizationDense.kt") public void testSwitchOptimizationDense() throws Exception { runTest("compiler/testData/codegen/box/when/switchOptimizationDense.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index bf531162a13..2515197cb31 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -31997,6 +31997,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/when/sealedWhenInitialization.kt"); } + @TestMetadata("switchBreakNoLabel.kt") + public void testSwitchBreakNoLabel() throws Exception { + runTest("compiler/testData/codegen/box/when/switchBreakNoLabel.kt"); + } + @TestMetadata("switchOptimizationDense.kt") public void testSwitchOptimizationDense() throws Exception { runTest("compiler/testData/codegen/box/when/switchOptimizationDense.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index 613bfcc7944..da30dd69c13 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -26003,6 +26003,11 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes runTest("compiler/testData/codegen/box/when/sealedWhenInitialization.kt"); } + @TestMetadata("switchBreakNoLabel.kt") + public void testSwitchBreakNoLabel() throws Exception { + runTest("compiler/testData/codegen/box/when/switchBreakNoLabel.kt"); + } + @TestMetadata("switchOptimizationDense.kt") public void testSwitchOptimizationDense() throws Exception { runTest("compiler/testData/codegen/box/when/switchOptimizationDense.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index a9f12b35a2a..84db96f38d4 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -26003,6 +26003,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/when/sealedWhenInitialization.kt"); } + @TestMetadata("switchBreakNoLabel.kt") + public void testSwitchBreakNoLabel() throws Exception { + runTest("compiler/testData/codegen/box/when/switchBreakNoLabel.kt"); + } + @TestMetadata("switchOptimizationDense.kt") public void testSwitchOptimizationDense() throws Exception { runTest("compiler/testData/codegen/box/when/switchOptimizationDense.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index d35966879bb..414a0eec4f7 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -26018,6 +26018,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/when/sealedWhenInitialization.kt"); } + @TestMetadata("switchBreakNoLabel.kt") + public void testSwitchBreakNoLabel() throws Exception { + runTest("compiler/testData/codegen/box/when/switchBreakNoLabel.kt"); + } + @TestMetadata("switchOptimizationDense.kt") public void testSwitchOptimizationDense() throws Exception { runTest("compiler/testData/codegen/box/when/switchOptimizationDense.kt");