Files
kotlin-fork/compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.fir.txt
T
Mads Ager e8a640851a FIR: Change the Fir2Ir handling of smart casts.
Generate the expression with the original type and then insert
an implicit conversion. That matches the behavior of psi2ir
better and therefore avoids breaking backend assumptions.

In particular, IrGetValue expects the type of the underlying
symbol and the type of the IrGetValue to be the same.
2020-01-31 09:31:52 +01:00

142 lines
12 KiB
Plaintext
Vendored

FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
FUN name:test1 visibility:public modality:FINAL <> (c:kotlin.Boolean?) returnType:kotlin.Unit
VALUE_PARAMETER name:c index:0 type:kotlin.Boolean?
BLOCK_BODY
WHILE label=L origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value=true
body: BLOCK type=kotlin.Unit origin=null
WHILE label=L2 origin=WHILE_LOOP
condition: BLOCK type=kotlin.Boolean origin=ELVIS
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Boolean? [val]
GET_VAR 'c: kotlin.Boolean? declared in <root>.test1' type=kotlin.Boolean? origin=null
WHEN type=kotlin.Boolean origin=ELVIS
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp_0: kotlin.Boolean? [val] declared in <root>.test1' type=kotlin.Boolean? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: BREAK label=null loop.label=L
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean
GET_VAR 'val tmp_0: kotlin.Boolean? [val] declared in <root>.test1' type=kotlin.Boolean? origin=null
body: BLOCK type=kotlin.Unit origin=null
FUN name:test2 visibility:public modality:FINAL <> (c:kotlin.Boolean?) returnType:kotlin.Unit
VALUE_PARAMETER name:c index:0 type:kotlin.Boolean?
BLOCK_BODY
WHILE label=L origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value=true
body: BLOCK type=kotlin.Unit origin=null
WHILE label=L2 origin=WHILE_LOOP
condition: BLOCK type=kotlin.Boolean origin=ELVIS
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Boolean? [val]
GET_VAR 'c: kotlin.Boolean? declared in <root>.test2' type=kotlin.Boolean? origin=null
WHEN type=kotlin.Boolean origin=ELVIS
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp_1: kotlin.Boolean? [val] declared in <root>.test2' type=kotlin.Boolean? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: CONTINUE label=null loop.label=L
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.Boolean origin=IMPLICIT_CAST typeOperand=kotlin.Boolean
GET_VAR 'val tmp_1: kotlin.Boolean? [val] declared in <root>.test2' type=kotlin.Boolean? origin=null
body: BLOCK type=kotlin.Unit origin=null
FUN name:test3 visibility:public modality:FINAL <> (ss:kotlin.collections.List<kotlin.String>?) returnType:kotlin.Unit
VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List<kotlin.String>?
BLOCK_BODY
WHILE label=L origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value=true
body: BLOCK type=kotlin.Unit origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.collections.List<kotlin.String> [val]
BLOCK type=kotlin.collections.List<kotlin.String> origin=ELVIS
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.collections.List<kotlin.String>? [val]
GET_VAR 'ss: kotlin.collections.List<kotlin.String>? declared in <root>.test3' type=kotlin.collections.List<kotlin.String>? origin=null
WHEN type=kotlin.collections.List<kotlin.String> origin=ELVIS
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp_3: kotlin.collections.List<kotlin.String>? [val] declared in <root>.test3' type=kotlin.collections.List<kotlin.String>? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: CONTINUE label=null loop.label=L
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.collections.List<kotlin.String> origin=IMPLICIT_CAST typeOperand=kotlin.collections.List<kotlin.String>
GET_VAR 'val tmp_3: kotlin.collections.List<kotlin.String>? [val] declared in <root>.test3' type=kotlin.collections.List<kotlin.String>? origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:kotlin.collections.Iterator<kotlin.String> [val]
CALL 'public abstract fun iterator (): kotlin.collections.Iterator<kotlin.String> [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator<kotlin.String> origin=null
$this: GET_VAR 'val tmp_2: kotlin.collections.List<kotlin.String> [val] declared in <root>.test3' type=kotlin.collections.List<kotlin.String> origin=null
WHILE label=L2 origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null
$this: GET_VAR 'val tmp_4: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.test3' type=kotlin.collections.Iterator<kotlin.String> origin=null
body: BLOCK type=kotlin.Unit origin=null
VAR name:s type:kotlin.String [val]
CALL 'public abstract fun next (): kotlin.String [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=null
$this: GET_VAR 'val tmp_4: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.test3' type=kotlin.collections.Iterator<kotlin.String> origin=null
FUN name:test4 visibility:public modality:FINAL <> (ss:kotlin.collections.List<kotlin.String>?) returnType:kotlin.Unit
VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List<kotlin.String>?
BLOCK_BODY
WHILE label=L origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value=true
body: BLOCK type=kotlin.Unit origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.collections.List<kotlin.String> [val]
BLOCK type=kotlin.collections.List<kotlin.String> origin=ELVIS
VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:kotlin.collections.List<kotlin.String>? [val]
GET_VAR 'ss: kotlin.collections.List<kotlin.String>? declared in <root>.test4' type=kotlin.collections.List<kotlin.String>? origin=null
WHEN type=kotlin.collections.List<kotlin.String> origin=ELVIS
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'val tmp_6: kotlin.collections.List<kotlin.String>? [val] declared in <root>.test4' type=kotlin.collections.List<kotlin.String>? origin=null
arg1: CONST Null type=kotlin.Nothing? value=null
then: BREAK label=null loop.label=L
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: TYPE_OP type=kotlin.collections.List<kotlin.String> origin=IMPLICIT_CAST typeOperand=kotlin.collections.List<kotlin.String>
GET_VAR 'val tmp_6: kotlin.collections.List<kotlin.String>? [val] declared in <root>.test4' type=kotlin.collections.List<kotlin.String>? origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.collections.Iterator<kotlin.String> [val]
CALL 'public abstract fun iterator (): kotlin.collections.Iterator<kotlin.String> [operator] declared in kotlin.collections.List' type=kotlin.collections.Iterator<kotlin.String> origin=null
$this: GET_VAR 'val tmp_5: kotlin.collections.List<kotlin.String> [val] declared in <root>.test4' type=kotlin.collections.List<kotlin.String> origin=null
WHILE label=L2 origin=FOR_LOOP_INNER_WHILE
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null
$this: GET_VAR 'val tmp_7: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.test4' type=kotlin.collections.Iterator<kotlin.String> origin=null
body: BLOCK type=kotlin.Unit origin=null
VAR name:s type:kotlin.String [val]
CALL 'public abstract fun next (): kotlin.String [operator] declared in kotlin.collections.Iterator' type=kotlin.String origin=null
$this: GET_VAR 'val tmp_7: kotlin.collections.Iterator<kotlin.String> [val] declared in <root>.test4' type=kotlin.collections.Iterator<kotlin.String> origin=null
FUN name:test5 visibility:public modality:FINAL <> () returnType:kotlin.Unit
BLOCK_BODY
VAR name:i type:kotlin.Int [var]
CONST Int type=kotlin.Int value=0
WHILE label=Outer origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value=true
body: BLOCK type=kotlin.Unit origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:kotlin.Int [val]
GET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
SET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_8: kotlin.Int [val] declared in <root>.test5' type=kotlin.Int origin=null
GET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
VAR name:j type:kotlin.Int [var]
CONST Int type=kotlin.Int value=0
DO_WHILE label=Inner origin=DO_WHILE_LOOP
body: BLOCK type=kotlin.Int origin=null
VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Int [val]
GET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
SET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'val tmp_9: kotlin.Int [val] declared in <root>.test5' type=kotlin.Int origin=null
GET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
condition: WHEN type=kotlin.Boolean origin=IF
BRANCH
if: CALL 'public final fun greaterOrEqual (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GTEQ
arg0: GET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value=3
then: CONST Boolean type=kotlin.Boolean value=false
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: BREAK label=null loop.label=Outer
WHEN type=kotlin.Unit origin=IF
BRANCH
if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ
arg0: GET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
arg1: CONST Int type=kotlin.Int value=3
then: BREAK label=null loop.label=Outer