[IR] Fix KT-59346, KT-55993

#KT-59346
#KT-55993
This commit is contained in:
Evgeniy.Zhelenskiy
2023-06-15 19:12:49 +02:00
committed by Space Team
parent e802ee05a7
commit 2d920df507
19 changed files with 212 additions and 6 deletions
@@ -52977,6 +52977,18 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@Test
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@Test
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@Test
@TestMetadata("longCondition.kt")
public void testLongCondition() throws Exception {
@@ -52977,6 +52977,18 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@Test
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@Test
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@Test
@TestMetadata("longCondition.kt")
public void testLongCondition() throws Exception {
@@ -792,6 +792,7 @@ class ExpressionCodegen(
declaration.markLineNumber(startOffset = true)
mv.store(index, varType)
} else if (declaration.isVisibleInLVT) {
declaration.markLineNumber(startOffset = true)
pushDefaultValueOnStack(varType, mv)
mv.store(index, varType)
}
+15
View File
@@ -0,0 +1,15 @@
// CHECK_BYTECODE_TEXT
fun test(boolean: Boolean) {
if (boolean) { // Breakpoint
throw IllegalArgumentException()
}
val x: Int
}
fun box(): String {
test(false)
return "OK"
}
// 1 LINENUMBER 7 L1\n +ICONST_0\n +ISTORE 1
+15
View File
@@ -0,0 +1,15 @@
// CHECK_BYTECODE_TEXT
fun test(boolean: Boolean) {
val x: Int // Breakpoint
if (boolean) {
throw IllegalArgumentException()
}
}
fun box(): String {
test(false)
return "OK"
}
// 1 LINENUMBER 4
@@ -11,16 +11,15 @@ fun box() {
}
}
// The JVM IR backend does not generate line number information for the
// declaration of local variables without initializer. Stepping through
// those does not seem useful. This is consistent with javac behavior
// as well. The JVM backend does generate these line numbers.
// The JVM IR backend does generate line number information for the
// declaration of local variables without initializer.
// Stepping through those is useful for breakpoinnts.
// The JVM backend does generate these line numbers as well.
// EXPECTATIONS JVM
// EXPECTATIONS JVM JVM_IR
// test.kt:4 box
// test.kt:5 box
// test.kt:6 box
// EXPECTATIONS JVM JVM_IR
// test.kt:7 box
// test.kt:8 box
// test.kt:9 box
@@ -49941,6 +49941,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@Test
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@Test
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@Test
@TestMetadata("longInRange.kt")
public void testLongInRange() throws Exception {
@@ -52977,6 +52977,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@Test
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@Test
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@Test
@TestMetadata("longCondition.kt")
public void testLongCondition() throws Exception {
@@ -52977,6 +52977,18 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@Test
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@Test
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@Test
@TestMetadata("longCondition.kt")
public void testLongCondition() throws Exception {
@@ -40717,6 +40717,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@TestMetadata("longInRange.kt")
public void testLongInRange() throws Exception {
runTest("compiler/testData/codegen/box/when/longInRange.kt");
@@ -36483,6 +36483,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@Test
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@Test
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@Test
@TestMetadata("longInRange.kt")
public void testLongInRange() throws Exception {
@@ -36909,6 +36909,18 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@Test
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@Test
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@Test
@TestMetadata("longInRange.kt")
public void testLongInRange() throws Exception {
@@ -36909,6 +36909,18 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@Test
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@Test
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@Test
@TestMetadata("longInRange.kt")
public void testLongInRange() throws Exception {
@@ -36909,6 +36909,18 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@Test
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@Test
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@Test
@TestMetadata("longInRange.kt")
public void testLongInRange() throws Exception {
@@ -40587,6 +40587,18 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@Test
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@Test
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@Test
@TestMetadata("longInRange.kt")
public void testLongInRange() throws Exception {
@@ -41621,6 +41621,18 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@Test
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@Test
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@Test
@TestMetadata("longInRange.kt")
public void testLongInRange() throws Exception {
@@ -40071,6 +40071,18 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@Test
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@Test
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@Test
@TestMetadata("longInRange.kt")
public void testLongInRange() throws Exception {
@@ -40588,6 +40588,18 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@Test
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@Test
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@Test
@TestMetadata("longInRange.kt")
public void testLongInRange() throws Exception {
@@ -32997,6 +32997,16 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/when/kt5448.kt");
}
@TestMetadata("kt55993.kt")
public void testKt55993() throws Exception {
runTest("compiler/testData/codegen/box/when/kt55993.kt");
}
@TestMetadata("kt59346.kt")
public void testKt59346() throws Exception {
runTest("compiler/testData/codegen/box/when/kt59346.kt");
}
@TestMetadata("longInRange.kt")
public void testLongInRange() throws Exception {
runTest("compiler/testData/codegen/box/when/longInRange.kt");