Put default value (null or zero) to slot for uninitialized values

This way range of the variable is correct in LVT.
 #KT-24672 Fixed
This commit is contained in:
Ilmir Usmanov
2018-12-26 17:56:44 +03:00
parent 8ab9226805
commit a52f430d8f
14 changed files with 360 additions and 0 deletions
@@ -2585,6 +2585,74 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/localInitializationLVT")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class LocalInitializationLVT extends AbstractBytecodeTextTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInLocalInitializationLVT() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeText/localInitializationLVT"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("boxing.kt")
public void testBoxing() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/boxing.kt");
}
@TestMetadata("contract.kt")
public void testContract() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/contract.kt");
}
@TestMetadata("generics.kt")
public void testGenerics() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/generics.kt");
}
@TestMetadata("ifStatement.kt")
public void testIfStatement() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatement.kt");
}
@TestMetadata("ifStatementWithoutBlock.kt")
public void testIfStatementWithoutBlock() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/ifStatementWithoutBlock.kt");
}
@TestMetadata("inlineClass.kt")
public void testInlineClass() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/inlineClass.kt");
}
@TestMetadata("lateinit.kt")
public void testLateinit() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/lateinit.kt");
}
@TestMetadata("run.kt")
public void testRun() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/run.kt");
}
@TestMetadata("singleBlock.kt")
public void testSingleBlock() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/singleBlock.kt");
}
@TestMetadata("var.kt")
public void testVar() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/var.kt");
}
@TestMetadata("whenStatement.kt")
public void testWhenStatement() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/localInitializationLVT/whenStatement.kt");
}
}
@TestMetadata("compiler/testData/codegen/bytecodeText/multifileClasses")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)