Add debug test using constant local
- This test checks that constant sharing optimization does not
impact debug behavior.
- One test is ignored because D8 replace goto targeting a return
instruction by the return instruction but it breaks the debug
behavior.
Bug: 65402086
Change-Id: I5c97c7c6f9820042e22f1e3f6e07cad562a3681b
diff --git a/src/test/debugTestResources/Locals.java b/src/test/debugTestResources/Locals.java
index 5afcabb..1221234 100644
--- a/src/test/debugTestResources/Locals.java
+++ b/src/test/debugTestResources/Locals.java
@@ -318,6 +318,26 @@
nop();
}
+ public static int localConstant(boolean b) {
+ if (b) {
+ int result1 = 1;
+ return result1;
+ } else {
+ int result2 = 2;
+ return result2;
+ }
+ }
+
+ public static int localConstantBis(boolean b) {
+ int result = 0;
+ if (b) {
+ result = 1;
+ } else {
+ result = 2;
+ }
+ return result;
+ }
+
public static void main(String[] args) {
noLocals();
unusedLocals();
@@ -338,5 +358,7 @@
switchRewriteToSwitches(1);
regression65039701(true);
regression65066975(false);
+ System.out.println(localConstant(true));
+ System.out.println(localConstantBis(true));
}
}