Fix debugger-related tests after dead code elimination improvements

This commit is contained in:
Dmitry Petrov
2017-05-12 17:56:55 +03:00
parent fe7870a1cd
commit 65799a5cb4
4 changed files with 9 additions and 25 deletions
@@ -1,14 +0,0 @@
fun box() {
lookAtMe {
12
}
}
inline fun lookAtMe(f: () -> Int): Int {
val a = 42
a + f() // Even this line already has meaningful instraction nop is still generated
return 13
}
// TODO: Less NOPs is better
// 2 NOP
+4 -2
View File
@@ -1,7 +1,9 @@
fun foo() {
if (0 < 1) {
if (flag) {
return
}
}
// 2 3 5
val flag = true
// 2 3 5 7 7
+5 -3
View File
@@ -1,15 +1,17 @@
fun foo() {
if (0 < 1) {
if (flag) {
System.out?.println()
} else {
System.out?.println()
}
val b = if (1 < 2) {
val b = if (flag) {
System.out?.println()
} else {
System.out?.println()
}
}
// 2 3 5 6 +8 9 11 8 13
val flag = true
// 2 3 5 6 +8 9 11 8 13 15 15
@@ -1415,12 +1415,6 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest {
doTest(fileName);
}
@TestMetadata("linenumberForNoParametersArgumentCallInExpression.kt")
public void testLinenumberForNoParametersArgumentCallInExpression() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/inline/linenumberForNoParametersArgumentCallInExpression.kt");
doTest(fileName);
}
@TestMetadata("linenumberForOneParametersArgumentCall.kt")
public void testLinenumberForOneParametersArgumentCall() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/inline/linenumberForOneParametersArgumentCall.kt");