Support Long and Char in const-bounded counter loop generation
If the loop end value is a compile-time constant (best we can do now), and it is safe to iterate over a given range using "naive" for loop (using '<=' or '>=' in loop condition), generate such loops for Longs and Chars as well Ints (Bytes, Shorts).
This commit is contained in:
@@ -1289,12 +1289,24 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("forInRangeToCharConst.kt")
|
||||
public void testForInRangeToCharConst() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharConst.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("forInRangeToConst.kt")
|
||||
public void testForInRangeToConst() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToConst.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("forInRangeToLongConst.kt")
|
||||
public void testForInRangeToLongConst() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToLongConst.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("forInRangeWithImplicitReceiver.kt")
|
||||
public void testForInRangeWithImplicitReceiver() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInRangeWithImplicitReceiver.kt");
|
||||
|
||||
Reference in New Issue
Block a user