FIR2IR: add test for KT-55458

This commit is contained in:
Mikhail Glukhikh
2023-01-30 16:23:34 +01:00
committed by Space Team
parent 9378da6f27
commit 1c4d9175e7
9 changed files with 70 additions and 0 deletions
@@ -2678,6 +2678,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
runTest("compiler/testData/ir/irText/firProblems/kt43342.kt");
}
@Test
@TestMetadata("kt55458.kt")
public void testKt55458() throws Exception {
runTest("compiler/testData/ir/irText/firProblems/kt55458.kt");
}
@Test
@TestMetadata("lambdaInEnumEntryConstructorCall.kt")
public void testLambdaInEnumEntryConstructorCall() throws Exception {
@@ -2678,6 +2678,12 @@ public class LightTreeFir2IrTextTestGenerated extends AbstractLightTreeFir2IrTex
runTest("compiler/testData/ir/irText/firProblems/kt43342.kt");
}
@Test
@TestMetadata("kt55458.kt")
public void testKt55458() throws Exception {
runTest("compiler/testData/ir/irText/firProblems/kt55458.kt");
}
@Test
@TestMetadata("lambdaInEnumEntryConstructorCall.kt")
public void testLambdaInEnumEntryConstructorCall() throws Exception {
@@ -0,0 +1,14 @@
FILE fqName:<root> fileName:/kt55458.kt
FUN name:main visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Pair<kotlin.Int, kotlin.Int> [val]
CALL 'public final fun to <A, B> (that: B of kotlin.TuplesKt.to): kotlin.Pair<A of kotlin.TuplesKt.to, B of kotlin.TuplesKt.to> [infix] declared in kotlin.TuplesKt' type=kotlin.Pair<kotlin.Int, kotlin.Int> origin=null
<A>: kotlin.Int
<B>: kotlin.Int
$receiver: CONST Int type=kotlin.Int value=1
that: CONST Int type=kotlin.Int value=2
VAR name:a type:kotlin.Int [val]
CALL 'public final fun component1 (): A of kotlin.Pair [operator] declared in kotlin.Pair' type=kotlin.Int origin=COMPONENT_N(index=1)
$this: GET_VAR 'val tmp_0: kotlin.Pair<kotlin.Int, kotlin.Int> [val] declared in <root>.main' type=kotlin.Pair<kotlin.Int, kotlin.Int> origin=null
CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io.ConsoleKt' type=kotlin.Unit origin=null
message: GET_VAR 'val a: kotlin.Int [val] declared in <root>.main' type=kotlin.Any origin=null
@@ -0,0 +1,5 @@
fun main() {
val <destruct>: Pair<Int, Int> = 1.to<Int, Int>(that = 2)
val a: Int = <destruct>.component1()
println(message = a)
}
+15
View File
@@ -0,0 +1,15 @@
FILE fqName:<root> fileName:/kt55458.kt
FUN name:main visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
COMPOSITE type=kotlin.Unit origin=DESTRUCTURING_DECLARATION
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Pair<kotlin.Int, kotlin.Int> [val]
CALL 'public final fun to <A, B> (that: B of kotlin.TuplesKt.to): kotlin.Pair<A of kotlin.TuplesKt.to, B of kotlin.TuplesKt.to> [infix] declared in kotlin.TuplesKt' type=kotlin.Pair<kotlin.Int, kotlin.Int> origin=null
<A>: kotlin.Int
<B>: kotlin.Int
$receiver: CONST Int type=kotlin.Int value=1
that: CONST Int type=kotlin.Int value=2
VAR name:a type:kotlin.Int [val]
CALL 'public final fun component1 (): A of kotlin.Pair [operator] declared in kotlin.Pair' type=kotlin.Int origin=COMPONENT_N(index=1)
$this: GET_VAR 'val tmp_0: kotlin.Pair<kotlin.Int, kotlin.Int> [val] declared in <root>.main' type=kotlin.Pair<kotlin.Int, kotlin.Int> origin=null
CALL 'public final fun println (message: kotlin.Int): kotlin.Unit [inline] declared in kotlin.io.ConsoleKt' type=kotlin.Unit origin=null
message: GET_VAR 'val a: kotlin.Int [val] declared in <root>.main' type=kotlin.Int origin=null
+6
View File
@@ -0,0 +1,6 @@
// WITH_STDLIB
fun main() {
val (a: Any, _) = 1 to 2
println(a)
}
@@ -0,0 +1,7 @@
fun main() {
// COMPOSITE {
val tmp0_container: Pair<Int, Int> = 1.to<Int, Int>(that = 2)
val a: Int = tmp0_container.component1()
// }
println(message = a)
}
@@ -2678,6 +2678,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest {
runTest("compiler/testData/ir/irText/firProblems/kt43342.kt");
}
@Test
@TestMetadata("kt55458.kt")
public void testKt55458() throws Exception {
runTest("compiler/testData/ir/irText/firProblems/kt55458.kt");
}
@Test
@TestMetadata("lambdaInEnumEntryConstructorCall.kt")
public void testLambdaInEnumEntryConstructorCall() throws Exception {
@@ -1960,6 +1960,11 @@ public class KlibTextTestCaseGenerated extends AbstractKlibTextTestCase {
runTest("compiler/testData/ir/irText/firProblems/kt43342.kt");
}
@TestMetadata("kt55458.kt")
public void testKt55458() throws Exception {
runTest("compiler/testData/ir/irText/firProblems/kt55458.kt");
}
@TestMetadata("lambdaInEnumEntryConstructorCall.kt")
public void testLambdaInEnumEntryConstructorCall() throws Exception {
runTest("compiler/testData/ir/irText/firProblems/lambdaInEnumEntryConstructorCall.kt");