Add psi2ir tests for 'break' and 'continue' inside 'when'
This commit is contained in:
+5
@@ -747,6 +747,11 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
|
||||
runTest("compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("breakContinueInWhen.kt")
|
||||
public void testBreakContinueInWhen() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/expressions/breakContinueInWhen.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("callWithReorderedArguments.kt")
|
||||
public void testCallWithReorderedArguments() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/expressions/callWithReorderedArguments.kt");
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
FILE fqName:<root> fileName:/breakContinueInWhen.kt
|
||||
FUN name:testBreakFor visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:xs type:kotlin.IntArray [val]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (size: kotlin.Int, init: kotlin.Function1<kotlin.Int, kotlin.Int>) declared in kotlin.IntArray' type=kotlin.IntArray origin=null
|
||||
size: CONST Int type=kotlin.Int value=10
|
||||
init: FUN_EXPR type=kotlin.Function1<kotlin.Int, kotlin.Int> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (i:kotlin.Int) returnType:kotlin.Int
|
||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
GET_VAR 'i: kotlin.Int declared in <root>.testBreakFor.<anonymous>' type=kotlin.Int origin=null
|
||||
VAR name:k type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
VAR name:<range> type:kotlin.IntArray [val]
|
||||
GET_VAR 'val xs: kotlin.IntArray [val] declared in <root>.testBreakFor' type=kotlin.IntArray origin=null
|
||||
VAR name:<iterator> type:kotlin.collections.IntIterator [val]
|
||||
CALL 'public final fun iterator (): kotlin.collections.IntIterator declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null
|
||||
$this: GET_VAR 'val <range>: kotlin.IntArray [val] declared in <root>.testBreakFor' type=kotlin.IntArray origin=null
|
||||
WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
||||
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null
|
||||
$this: GET_VAR 'val <iterator>: kotlin.collections.IntIterator [val] declared in <root>.testBreakFor' type=kotlin.collections.IntIterator origin=null
|
||||
body: BLOCK type=kotlin.Unit origin=null
|
||||
VAR name:x type:kotlin.Int [val]
|
||||
CALL 'public final fun next (): kotlin.Int declared in kotlin.collections.IntIterator' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val <iterator>: kotlin.collections.IntIterator [val] declared in <root>.testBreakFor' type=kotlin.collections.IntIterator origin=null
|
||||
WHEN type=kotlin.Unit origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakFor' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: BREAK label=null loop.label=null
|
||||
FUN name:testBreakWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:k type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
WHILE label=null origin=WHILE_LOOP
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=10
|
||||
body: WHEN type=kotlin.Unit origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: BREAK label=null loop.label=null
|
||||
FUN name:testBreakDoWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:k type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: WHEN type=kotlin.Unit origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: BREAK label=null loop.label=null
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=10
|
||||
FUN name:testContinueFor visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:xs type:kotlin.IntArray [val]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (size: kotlin.Int, init: kotlin.Function1<kotlin.Int, kotlin.Int>) declared in kotlin.IntArray' type=kotlin.IntArray origin=null
|
||||
size: CONST Int type=kotlin.Int value=10
|
||||
init: FUN_EXPR type=kotlin.Function1<kotlin.Int, kotlin.Int> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (i:kotlin.Int) returnType:kotlin.Int
|
||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
GET_VAR 'i: kotlin.Int declared in <root>.testContinueFor.<anonymous>' type=kotlin.Int origin=null
|
||||
VAR name:k type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
VAR name:<range> type:kotlin.IntArray [val]
|
||||
GET_VAR 'val xs: kotlin.IntArray [val] declared in <root>.testContinueFor' type=kotlin.IntArray origin=null
|
||||
VAR name:<iterator> type:kotlin.collections.IntIterator [val]
|
||||
CALL 'public final fun iterator (): kotlin.collections.IntIterator declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=null
|
||||
$this: GET_VAR 'val <range>: kotlin.IntArray [val] declared in <root>.testContinueFor' type=kotlin.IntArray origin=null
|
||||
WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
||||
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null
|
||||
$this: GET_VAR 'val <iterator>: kotlin.collections.IntIterator [val] declared in <root>.testContinueFor' type=kotlin.collections.IntIterator origin=null
|
||||
body: BLOCK type=kotlin.Unit origin=null
|
||||
VAR name:x type:kotlin.Int [val]
|
||||
CALL 'public final fun next (): kotlin.Int declared in kotlin.collections.IntIterator' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val <iterator>: kotlin.collections.IntIterator [val] declared in <root>.testContinueFor' type=kotlin.collections.IntIterator origin=null
|
||||
WHEN type=kotlin.Unit origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueFor' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: CONTINUE label=null loop.label=null
|
||||
FUN name:testContinueWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:k type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
WHILE label=null origin=WHILE_LOOP
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=10
|
||||
body: WHEN type=kotlin.Unit origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: CONTINUE label=null loop.label=null
|
||||
FUN name:testContinueDoWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:k type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
VAR name:s type:kotlin.String [var]
|
||||
CONST String type=kotlin.String value=""
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: BLOCK type=kotlin.Unit origin=null
|
||||
VAR name:<unary> type:kotlin.Int [val]
|
||||
GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
SET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null
|
||||
$this: GET_VAR 'val <unary>: kotlin.Int [val] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
WHEN type=kotlin.Unit origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: CONTINUE label=null loop.label=null
|
||||
SET_VAR 'var s: kotlin.String [var] declared in <root>.testContinueDoWhile' type=kotlin.String origin=null
|
||||
STRING_CONCATENATION type=kotlin.String
|
||||
GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
CONST String type=kotlin.String value=";"
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=10
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: GET_VAR 'var s: kotlin.String [var] declared in <root>.testContinueDoWhile' type=kotlin.String origin=null
|
||||
arg1: CONST String type=kotlin.String value="1;2;"
|
||||
then: THROW type=kotlin.Nothing
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (detailMessage: kotlin.Any?) declared in java.lang.AssertionError' type=java.lang.AssertionError origin=null
|
||||
detailMessage: GET_VAR 'var s: kotlin.String [var] declared in <root>.testContinueDoWhile' type=kotlin.String origin=null
|
||||
@@ -0,0 +1,61 @@
|
||||
// !LANGUAGE: +AllowBreakAndContinueInsideWhen
|
||||
|
||||
fun testBreakFor() {
|
||||
val xs = IntArray(10) { i -> i }
|
||||
var k = 0
|
||||
for (x in xs) {
|
||||
when {
|
||||
k > 2 -> break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun testBreakWhile() {
|
||||
var k = 0
|
||||
while (k < 10) {
|
||||
when {
|
||||
k > 2 -> break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun testBreakDoWhile() {
|
||||
var k = 0
|
||||
do {
|
||||
when {
|
||||
k > 2 -> break
|
||||
}
|
||||
} while (k < 10)
|
||||
}
|
||||
|
||||
fun testContinueFor() {
|
||||
val xs = IntArray(10) { i -> i }
|
||||
var k = 0
|
||||
for (x in xs) {
|
||||
when {
|
||||
k > 2 -> continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun testContinueWhile() {
|
||||
var k = 0
|
||||
while (k < 10) {
|
||||
when {
|
||||
k > 2 -> continue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun testContinueDoWhile() {
|
||||
var k = 0
|
||||
var s = ""
|
||||
do {
|
||||
++k
|
||||
when {
|
||||
k > 2 -> continue
|
||||
}
|
||||
s += "$k;"
|
||||
} while (k < 10)
|
||||
if (s != "1;2;") throw AssertionError(s)
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
FILE fqName:<root> fileName:/breakContinueInWhen.kt
|
||||
FUN name:testBreakFor visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:xs type:kotlin.IntArray [val]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (size: kotlin.Int, init: kotlin.Function1<kotlin.Int, kotlin.Int>) declared in kotlin.IntArray' type=kotlin.IntArray origin=null
|
||||
size: CONST Int type=kotlin.Int value=10
|
||||
init: FUN_EXPR type=kotlin.Function1<kotlin.Int, kotlin.Int> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (i:kotlin.Int) returnType:kotlin.Int
|
||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (i: kotlin.Int): kotlin.Int declared in <root>.testBreakFor'
|
||||
GET_VAR 'i: kotlin.Int declared in <root>.testBreakFor.<anonymous>' type=kotlin.Int origin=null
|
||||
VAR name:k type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||
VAR FOR_LOOP_ITERATOR name:tmp0_iterator type:kotlin.collections.IntIterator [val]
|
||||
CALL 'public final fun iterator (): kotlin.collections.IntIterator declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=FOR_LOOP_ITERATOR
|
||||
$this: GET_VAR 'val xs: kotlin.IntArray [val] declared in <root>.testBreakFor' type=kotlin.IntArray origin=null
|
||||
WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
||||
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.IntIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
|
||||
$this: GET_VAR 'val tmp0_iterator: kotlin.collections.IntIterator [val] declared in <root>.testBreakFor' type=kotlin.collections.IntIterator origin=null
|
||||
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||
VAR FOR_LOOP_VARIABLE name:x type:kotlin.Int [val]
|
||||
CALL 'public final fun next (): kotlin.Int declared in kotlin.collections.IntIterator' type=kotlin.Int origin=FOR_LOOP_NEXT
|
||||
$this: GET_VAR 'val tmp0_iterator: kotlin.collections.IntIterator [val] declared in <root>.testBreakFor' type=kotlin.collections.IntIterator origin=null
|
||||
BLOCK type=kotlin.Nothing origin=null
|
||||
WHEN type=kotlin.Nothing origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakFor' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: BREAK label=null loop.label=null
|
||||
FUN name:testBreakWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:k type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
WHILE label=null origin=WHILE_LOOP
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=10
|
||||
body: BLOCK type=kotlin.Unit origin=null
|
||||
WHEN type=kotlin.Nothing origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: BREAK label=null loop.label=null
|
||||
FUN name:testBreakDoWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:k type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Unit origin=null
|
||||
WHEN type=kotlin.Nothing origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: BREAK label=null loop.label=null
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testBreakDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=10
|
||||
FUN name:testContinueFor visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:xs type:kotlin.IntArray [val]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (size: kotlin.Int, init: kotlin.Function1<kotlin.Int, kotlin.Int>) declared in kotlin.IntArray' type=kotlin.IntArray origin=null
|
||||
size: CONST Int type=kotlin.Int value=10
|
||||
init: FUN_EXPR type=kotlin.Function1<kotlin.Int, kotlin.Int> origin=LAMBDA
|
||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> (i:kotlin.Int) returnType:kotlin.Int
|
||||
VALUE_PARAMETER name:i index:0 type:kotlin.Int
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='local final fun <anonymous> (i: kotlin.Int): kotlin.Int declared in <root>.testContinueFor'
|
||||
GET_VAR 'i: kotlin.Int declared in <root>.testContinueFor.<anonymous>' type=kotlin.Int origin=null
|
||||
VAR name:k type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
BLOCK type=kotlin.Unit origin=FOR_LOOP
|
||||
VAR FOR_LOOP_ITERATOR name:tmp0_iterator type:kotlin.collections.IntIterator [val]
|
||||
CALL 'public final fun iterator (): kotlin.collections.IntIterator declared in kotlin.IntArray' type=kotlin.collections.IntIterator origin=FOR_LOOP_ITERATOR
|
||||
$this: GET_VAR 'val xs: kotlin.IntArray [val] declared in <root>.testContinueFor' type=kotlin.IntArray origin=null
|
||||
WHILE label=null origin=FOR_LOOP_INNER_WHILE
|
||||
condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.IntIterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT
|
||||
$this: GET_VAR 'val tmp0_iterator: kotlin.collections.IntIterator [val] declared in <root>.testContinueFor' type=kotlin.collections.IntIterator origin=null
|
||||
body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE
|
||||
VAR FOR_LOOP_VARIABLE name:x type:kotlin.Int [val]
|
||||
CALL 'public final fun next (): kotlin.Int declared in kotlin.collections.IntIterator' type=kotlin.Int origin=FOR_LOOP_NEXT
|
||||
$this: GET_VAR 'val tmp0_iterator: kotlin.collections.IntIterator [val] declared in <root>.testContinueFor' type=kotlin.collections.IntIterator origin=null
|
||||
BLOCK type=kotlin.Nothing origin=null
|
||||
WHEN type=kotlin.Nothing origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueFor' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: CONTINUE label=null loop.label=null
|
||||
FUN name:testContinueWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:k type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
WHILE label=null origin=WHILE_LOOP
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=10
|
||||
body: BLOCK type=kotlin.Unit origin=null
|
||||
WHEN type=kotlin.Nothing origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: CONTINUE label=null loop.label=null
|
||||
FUN name:testContinueDoWhile visibility:public modality:FINAL <> () returnType:kotlin.Unit
|
||||
BLOCK_BODY
|
||||
VAR name:k type:kotlin.Int [var]
|
||||
CONST Int type=kotlin.Int value=0
|
||||
VAR name:s type:kotlin.String [var]
|
||||
CONST String type=kotlin.String value=""
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Unit origin=null
|
||||
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
|
||||
BLOCK type=kotlin.Int origin=PREFIX_INCR
|
||||
SET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Unit origin=PREFIX_INCR
|
||||
CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=PREFIX_INCR
|
||||
$this: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=PREFIX_INCR
|
||||
GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=PREFIX_INCR
|
||||
WHEN type=kotlin.Nothing origin=WHEN
|
||||
BRANCH
|
||||
if: CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=2
|
||||
then: CONTINUE label=null loop.label=null
|
||||
SET_VAR 'var s: kotlin.String [var] declared in <root>.testContinueDoWhile' type=kotlin.Unit origin=PLUSEQ
|
||||
CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUSEQ
|
||||
$this: GET_VAR 'var s: kotlin.String [var] declared in <root>.testContinueDoWhile' type=kotlin.String origin=PLUSEQ
|
||||
other: STRING_CONCATENATION type=kotlin.String
|
||||
GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
CONST String type=kotlin.String value=";"
|
||||
condition: CALL 'public final fun less (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=LT
|
||||
arg0: GET_VAR 'var k: kotlin.Int [var] declared in <root>.testContinueDoWhile' type=kotlin.Int origin=null
|
||||
arg1: CONST Int type=kotlin.Int value=10
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: GET_VAR 'var s: kotlin.String [var] declared in <root>.testContinueDoWhile' type=kotlin.String origin=null
|
||||
arg1: CONST String type=kotlin.String value="1;2;"
|
||||
then: THROW type=kotlin.Nothing
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (detailMessage: kotlin.Any?) declared in java.lang.AssertionError' type=java.lang.AssertionError origin=null
|
||||
detailMessage: GET_VAR 'var s: kotlin.String [var] declared in <root>.testContinueDoWhile' type=kotlin.String origin=null
|
||||
@@ -747,6 +747,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
|
||||
runTest("compiler/testData/ir/irText/expressions/breakContinueInLoopHeader.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("breakContinueInWhen.kt")
|
||||
public void testBreakContinueInWhen() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/expressions/breakContinueInWhen.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("callWithReorderedArguments.kt")
|
||||
public void testCallWithReorderedArguments() throws Exception {
|
||||
runTest("compiler/testData/ir/irText/expressions/callWithReorderedArguments.kt");
|
||||
|
||||
Reference in New Issue
Block a user