[box-tests] Added a couple of reproducers for KT-52795
This commit is contained in:
+12
@@ -356,6 +356,18 @@ public class FirBlackBoxInlineCodegenTestGenerated extends AbstractFirBlackBoxIn
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
|
||||
+12
@@ -356,6 +356,18 @@ public class FirLightTreeBlackBoxInlineCodegenTestGenerated extends AbstractFirL
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
|
||||
+12
@@ -356,6 +356,18 @@ public class FirSerializeCompileKotlinAgainstInlineKotlinTestGenerated extends A
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
// FILE: 1.kt
|
||||
inline fun <T> mrun(block: () -> T) = block()
|
||||
|
||||
// FILE: 2.kt
|
||||
fun bar(o: String): String {
|
||||
val callable = mrun {
|
||||
fun localAnonymousFun(k: String): String {
|
||||
val obj = object {
|
||||
fun foo() = o + k
|
||||
}
|
||||
return obj.foo()
|
||||
}
|
||||
::localAnonymousFun
|
||||
}
|
||||
|
||||
return callable("K")
|
||||
}
|
||||
|
||||
fun box() = bar("O")
|
||||
@@ -0,0 +1,34 @@
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
// IGNORE_BACKEND: JVM, WASM
|
||||
// IGNORE_BACKEND_MULTI_MODULE: JVM, JVM_MULTI_MODULE_OLD_AGAINST_IR
|
||||
|
||||
import kotlin.IllegalStateException
|
||||
|
||||
// FILE: 1.kt
|
||||
inline fun <T> mrun(block: () -> T) = block()
|
||||
inline fun <T> mrunTwice(block: () -> T) : T {
|
||||
val first = block()
|
||||
val second = block()
|
||||
if (first!!::class != second!!::class)
|
||||
throw IllegalStateException("${first!!::class} != ${second!!::class}")
|
||||
return first
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
fun bar(o: String): String {
|
||||
val callable = mrun {
|
||||
fun localAnonymousFun(k: String): String {
|
||||
fun localAnonymousFunLevel2() = mrunTwice {
|
||||
object {
|
||||
fun foo() = o + k
|
||||
}
|
||||
}
|
||||
return localAnonymousFunLevel2().foo()
|
||||
}
|
||||
::localAnonymousFun
|
||||
}
|
||||
|
||||
return callable("K")
|
||||
}
|
||||
|
||||
fun box() = bar("O")
|
||||
+12
@@ -356,6 +356,18 @@ public class BlackBoxInlineCodegenTestGenerated extends AbstractBlackBoxInlineCo
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
|
||||
+12
@@ -356,6 +356,18 @@ public class CompileKotlinAgainstInlineKotlinTestGenerated extends AbstractCompi
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
|
||||
+12
@@ -356,6 +356,18 @@ public class IrBlackBoxInlineCodegenTestGenerated extends AbstractIrBlackBoxInli
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
|
||||
+12
@@ -356,6 +356,18 @@ public class IrCompileKotlinAgainstInlineKotlinTestGenerated extends AbstractIrC
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
|
||||
+12
@@ -356,6 +356,18 @@ public class IrSerializeCompileKotlinAgainstInlineKotlinTestGenerated extends Ab
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
|
||||
+12
@@ -356,6 +356,18 @@ public class JvmIrAgainstOldBoxInlineTestGenerated extends AbstractJvmIrAgainstO
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
|
||||
+12
@@ -356,6 +356,18 @@ public class JvmOldAgainstIrBoxInlineTestGenerated extends AbstractJvmOldAgainst
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
|
||||
+12
@@ -314,6 +314,18 @@ public class JsCodegenInlineTestGenerated extends AbstractJsCodegenInlineTest {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
|
||||
+12
@@ -314,6 +314,18 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
|
||||
+10
@@ -280,6 +280,16 @@ public class IrCodegenBoxInlineWasmTestGenerated extends AbstractIrCodegenBoxInl
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt6007.kt");
|
||||
|
||||
+12
@@ -40184,6 +40184,18 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt51950.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795.kt")
|
||||
public void testKt52795() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt52795_2.kt")
|
||||
public void testKt52795_2() throws Exception {
|
||||
runTest("compiler/testData/codegen/boxInline/anonymousObject/kt52795_2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt6007.kt")
|
||||
public void testKt6007() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user