Fix constant expression inlining logic

Constant expressions are inlined if they do not depend on non-inlineable
vals.
Java constants are always inlined.
Kotlin constants are inlined in LV 1.1+.
This commit is contained in:
Dmitry Petrov
2017-10-13 15:14:58 +03:00
parent 5acc992956
commit 16b7bece46
7 changed files with 68 additions and 12 deletions
@@ -1010,6 +1010,24 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
doTest(fileName);
}
@TestMetadata("noInlineNonStaticJavaField.kt")
public void testNoInlineNonStaticJavaField() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/constants/noInlineNonStaticJavaField.kt");
doTest(fileName);
}
@TestMetadata("noInlineNonStaticJavaField_lv10.kt")
public void testNoInlineNonStaticJavaField_lv10() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/constants/noInlineNonStaticJavaField_lv10.kt");
doTest(fileName);
}
@TestMetadata("noInlineNonStaticJavaField_lv11.kt")
public void testNoInlineNonStaticJavaField_lv11() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/constants/noInlineNonStaticJavaField_lv11.kt");
doTest(fileName);
}
@TestMetadata("nullableByteAndShort.kt")
public void testNullableByteAndShort() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/constants/nullableByteAndShort.kt");