Support bound callable reference inlining in IR

This commit is contained in:
Mikhael Bogdanov
2019-05-28 15:44:51 +02:00
parent 3c093f321d
commit 81e6416bfe
28 changed files with 461 additions and 180 deletions
@@ -44,6 +44,11 @@ public class IrCallableReferenceInlineTestsGenerated extends AbstractIrCallableR
runTest("compiler/testData/codegen/boxInline/callableReference/constructor.kt");
}
@TestMetadata("innerGenericConstuctor.kt")
public void testInnerGenericConstuctor() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/innerGenericConstuctor.kt");
}
@TestMetadata("intrinsic.kt")
public void testIntrinsic() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/intrinsic.kt");
@@ -111,6 +116,11 @@ public class IrCallableReferenceInlineTestsGenerated extends AbstractIrCallableR
runTest("compiler/testData/codegen/boxInline/callableReference/bound/emptyLhsFunction.kt");
}
@TestMetadata("emptyLhsProperty.kt")
public void testEmptyLhsProperty() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/emptyLhsProperty.kt");
}
@TestMetadata("expression.kt")
public void testExpression() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/expression.kt");
@@ -126,6 +136,11 @@ public class IrCallableReferenceInlineTestsGenerated extends AbstractIrCallableR
runTest("compiler/testData/codegen/boxInline/callableReference/bound/filter.kt");
}
@TestMetadata("innerGenericConstuctor.kt")
public void testInnerGenericConstuctor() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/innerGenericConstuctor.kt");
}
@TestMetadata("intrinsic.kt")
public void testIntrinsic() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/intrinsic.kt");
@@ -171,11 +186,26 @@ public class IrCallableReferenceInlineTestsGenerated extends AbstractIrCallableR
runTest("compiler/testData/codegen/boxInline/callableReference/bound/propertyImportedFromObject.kt");
}
@TestMetadata("sideEffect.kt")
public void testSideEffect() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/sideEffect.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/simple.kt");
}
@TestMetadata("simpleVal.kt")
public void testSimpleVal() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/simpleVal.kt");
}
@TestMetadata("simpleVal2.kt")
public void testSimpleVal2() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/simpleVal2.kt");
}
@TestMetadata("topLevelExtensionProperty.kt")
public void testTopLevelExtensionProperty() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/topLevelExtensionProperty.kt");
@@ -1486,34 +1486,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/callableReference/bound/equals/reflectionReference.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/callableReference/bound/inline")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Inline extends AbstractIrJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
}
public void testAllFilesPresentInInline() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/callableReference/bound/inline"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
}
@TestMetadata("emptyLhsProperty.kt")
public void testEmptyLhsProperty() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/inline/emptyLhsProperty.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/inline/simple.kt");
}
@TestMetadata("simpleVal.kt")
public void testSimpleVal() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/inline/simpleVal.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/box/callableReference/function")
@@ -44,6 +44,11 @@ public class CallableReferenceInlineTestsGenerated extends AbstractCallableRefer
runTest("compiler/testData/codegen/boxInline/callableReference/constructor.kt");
}
@TestMetadata("innerGenericConstuctor.kt")
public void testInnerGenericConstuctor() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/innerGenericConstuctor.kt");
}
@TestMetadata("intrinsic.kt")
public void testIntrinsic() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/intrinsic.kt");
@@ -111,6 +116,11 @@ public class CallableReferenceInlineTestsGenerated extends AbstractCallableRefer
runTest("compiler/testData/codegen/boxInline/callableReference/bound/emptyLhsFunction.kt");
}
@TestMetadata("emptyLhsProperty.kt")
public void testEmptyLhsProperty() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/emptyLhsProperty.kt");
}
@TestMetadata("expression.kt")
public void testExpression() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/expression.kt");
@@ -126,6 +136,11 @@ public class CallableReferenceInlineTestsGenerated extends AbstractCallableRefer
runTest("compiler/testData/codegen/boxInline/callableReference/bound/filter.kt");
}
@TestMetadata("innerGenericConstuctor.kt")
public void testInnerGenericConstuctor() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/innerGenericConstuctor.kt");
}
@TestMetadata("intrinsic.kt")
public void testIntrinsic() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/intrinsic.kt");
@@ -171,11 +186,26 @@ public class CallableReferenceInlineTestsGenerated extends AbstractCallableRefer
runTest("compiler/testData/codegen/boxInline/callableReference/bound/propertyImportedFromObject.kt");
}
@TestMetadata("sideEffect.kt")
public void testSideEffect() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/sideEffect.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/simple.kt");
}
@TestMetadata("simpleVal.kt")
public void testSimpleVal() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/simpleVal.kt");
}
@TestMetadata("simpleVal2.kt")
public void testSimpleVal2() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/simpleVal2.kt");
}
@TestMetadata("topLevelExtensionProperty.kt")
public void testTopLevelExtensionProperty() throws Exception {
runTest("compiler/testData/codegen/boxInline/callableReference/bound/topLevelExtensionProperty.kt");
@@ -1486,34 +1486,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/callableReference/bound/equals/reflectionReference.kt");
}
}
@TestMetadata("compiler/testData/codegen/box/callableReference/bound/inline")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Inline extends AbstractJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
}
public void testAllFilesPresentInInline() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/callableReference/bound/inline"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
}
@TestMetadata("emptyLhsProperty.kt")
public void testEmptyLhsProperty() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/inline/emptyLhsProperty.kt");
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/inline/simple.kt");
}
@TestMetadata("simpleVal.kt")
public void testSimpleVal() throws Exception {
runTest("compiler/testData/codegen/box/callableReference/bound/inline/simpleVal.kt");
}
}
}
@TestMetadata("compiler/testData/codegen/box/callableReference/function")