Add regression test for KT-54707

This commit is contained in:
Alexander Udalov
2022-10-28 16:05:59 +02:00
parent 8e52babb42
commit 54ab66cd4e
9 changed files with 61 additions and 0 deletions
@@ -4823,6 +4823,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/casts/kt54581.kt");
}
@Test
@TestMetadata("kt54707.kt")
public void testKt54707() throws Exception {
runTest("compiler/testData/codegen/box/casts/kt54707.kt");
}
@Test
@TestMetadata("lambdaToUnitCast.kt")
public void testLambdaToUnitCast() throws Exception {
+15
View File
@@ -0,0 +1,15 @@
// IGNORE_BACKEND: JVM
// IGNORE_LIGHT_ANALYSIS
fun box(): String =
g(arrayOf("O"))
fun g(x: Array<String>?): String =
x.orEmpty0().f { it + "K" }
inline fun <T> Array<out T>.f(lambda: (T) -> T): T =
lambda(this[0])
inline fun <reified T> Array<out T>?.orEmpty0(): Array<out T> =
this ?: (arrayOfNulls<T>(0) as Array<T>)
@@ -4691,6 +4691,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/casts/kt54581.kt");
}
@Test
@TestMetadata("kt54707.kt")
public void testKt54707() throws Exception {
runTest("compiler/testData/codegen/box/casts/kt54707.kt");
}
@Test
@TestMetadata("lambdaToUnitCast.kt")
public void testLambdaToUnitCast() throws Exception {
@@ -4823,6 +4823,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/casts/kt54581.kt");
}
@Test
@TestMetadata("kt54707.kt")
public void testKt54707() throws Exception {
runTest("compiler/testData/codegen/box/casts/kt54707.kt");
}
@Test
@TestMetadata("lambdaToUnitCast.kt")
public void testLambdaToUnitCast() throws Exception {
@@ -3958,6 +3958,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Casts extends AbstractLightAnalysisModeTest {
@TestMetadata("kt54707.kt")
public void ignoreKt54707() throws Exception {
runTest("compiler/testData/codegen/box/casts/kt54707.kt");
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
@@ -3413,6 +3413,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/casts/kt50577.kt");
}
@Test
@TestMetadata("kt54707.kt")
public void testKt54707() throws Exception {
runTest("compiler/testData/codegen/box/casts/kt54707.kt");
}
@Test
@TestMetadata("lambdaToUnitCast.kt")
public void testLambdaToUnitCast() throws Exception {
@@ -3473,6 +3473,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/casts/kt53677.kt");
}
@Test
@TestMetadata("kt54707.kt")
public void testKt54707() throws Exception {
runTest("compiler/testData/codegen/box/casts/kt54707.kt");
}
@Test
@TestMetadata("lambdaToUnitCast.kt")
public void testLambdaToUnitCast() throws Exception {
@@ -3066,6 +3066,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
runTest("compiler/testData/codegen/box/casts/kt53677.kt");
}
@TestMetadata("kt54707.kt")
public void testKt54707() throws Exception {
runTest("compiler/testData/codegen/box/casts/kt54707.kt");
}
@TestMetadata("lambdaToUnitCast.kt")
public void testLambdaToUnitCast() throws Exception {
runTest("compiler/testData/codegen/box/casts/lambdaToUnitCast.kt");
@@ -3547,6 +3547,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
runTest("compiler/testData/codegen/box/casts/kt53677.kt");
}
@Test
@TestMetadata("kt54707.kt")
public void testKt54707() throws Exception {
runTest("compiler/testData/codegen/box/casts/kt54707.kt");
}
@Test
@TestMetadata("lambdaToUnitCast.kt")
public void testLambdaToUnitCast() throws Exception {