KT-22334 Specialized loops using range such as integer..array.size-1
- Into PrimitiveNumberRangeLiteralRangeValue modifies how bounded value are created by checking if the high bound range can be modified to be exclusive instead of inclusive such as the generated code will be optimized. - Add black box tests checking that the specialization does not fail on any kind of arrays. - Add a bytecode test checking that the code is correctly optimized. Fix of https://youtrack.jetbrains.com/issue/KT-22334
This commit is contained in:
committed by
Dmitry Petrov
parent
8c8caa4707
commit
8676ca34d7
@@ -1305,6 +1305,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("forInRangeSpecializedToUntil.kt")
|
||||
public void testForInRangeSpecializedToUntil() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInRangeSpecializedToUntil.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("forInRangeToCharConst.kt")
|
||||
public void testForInRangeToCharConst() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/forLoop/forInRangeToCharConst.kt");
|
||||
|
||||
Reference in New Issue
Block a user