ART: Print C1vis lists as [v1,...,vN]
Checker interprets whitespace as a don't-care placeholder, making it
easier to write assertions which test only parts of the output (e.g.
"//CHECK: Add liveness:44" does not test the inputs or any other
attributes apart from "liveness").
However, since the GraphVisualizer prints lists with elements
separated by spaces ("[ v1 ... vN ]"), this allows for false positives
caused by an occurrence elsewhere in the output. For example, the
assertion: "//CHECK: [ x y ]" will match "[ x y ]" but also
"[ x a y b ]" or even "[ x ] abc [ y ]".
Switching to comma-separated lists works around this issue.
This patch updates all test files, fixes one false positive that this
change revealed (test 442, line 337) and two occurrences of a wrong
match (test 462, lines 121, 149).
Bug: 21189305
Change-Id: I3b22503be3d92529dac0b13f66bccbcfabea6721
diff --git a/test/462-checker-inlining-across-dex-files/src/Main.java b/test/462-checker-inlining-across-dex-files/src/Main.java
index 5ebf3d1..3d583b4 100644
--- a/test/462-checker-inlining-across-dex-files/src/Main.java
+++ b/test/462-checker-inlining-across-dex-files/src/Main.java
@@ -34,14 +34,14 @@
// CHECK-START: int Main.inlineReturnIntMethod() inliner (before)
// CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: int Main.inlineReturnIntMethod() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
// CHECK-START: int Main.inlineReturnIntMethod() inliner (after)
// CHECK-DAG: <<Const38:i\d+>> IntConstant 38
- // CHECK-DAG: Return [ <<Const38>> ]
+ // CHECK-DAG: Return [<<Const38>>]
public static int inlineReturnIntMethod() {
return OtherDex.returnIntMethod();
@@ -49,11 +49,11 @@
// CHECK-START: int Main.dontInlineOtherDexStatic() inliner (before)
// CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: int Main.dontInlineOtherDexStatic() inliner (after)
// CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
public static int dontInlineOtherDexStatic() {
return OtherDex.returnOtherDexStatic();
@@ -61,14 +61,14 @@
// CHECK-START: int Main.inlineMainStatic() inliner (before)
// CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: int Main.inlineMainStatic() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
// CHECK-START: int Main.inlineMainStatic() inliner (after)
// CHECK-DAG: <<Static:i\d+>> StaticFieldGet
- // CHECK-DAG: Return [ <<Static>> ]
+ // CHECK-DAG: Return [<<Static>>]
public static int inlineMainStatic() {
return OtherDex.returnMainStatic();
@@ -76,11 +76,11 @@
// CHECK-START: int Main.dontInlineRecursiveCall() inliner (before)
// CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: int Main.dontInlineRecursiveCall() inliner (after)
// CHECK-DAG: <<Invoke:i\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
public static int dontInlineRecursiveCall() {
return OtherDex.recursiveCall();
@@ -88,11 +88,11 @@
// CHECK-START: java.lang.String Main.dontInlineReturnString() inliner (before)
// CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: java.lang.String Main.dontInlineReturnString() inliner (after)
// CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
public static String dontInlineReturnString() {
return OtherDex.returnString();
@@ -100,11 +100,11 @@
// CHECK-START: java.lang.Class Main.dontInlineOtherDexClass() inliner (before)
// CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: java.lang.Class Main.dontInlineOtherDexClass() inliner (after)
// CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
public static Class dontInlineOtherDexClass() {
return OtherDex.returnOtherDexClass();
@@ -112,14 +112,15 @@
// CHECK-START: java.lang.Class Main.inlineMainClass() inliner (before)
// CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: java.lang.Class Main.inlineMainClass() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
// CHECK-START: java.lang.Class Main.inlineMainClass() inliner (after)
- // CHECK-DAG: <<Class:l\d+>> LoadClass
- // CHECK-DAG: Return [ <<Class>> ]
+ // CHECK-DAG: Return [<<Class:l\d+>>]
+ // CHECK-DAG: <<Class>> LoadClass
+ // Note: Verify backwards because there are two LoadClass instructions
public static Class inlineMainClass() {
return OtherDex.returnMainClass();
@@ -127,11 +128,11 @@
// CHECK-START: java.lang.Class Main.dontInlineOtherDexClassStaticCall() inliner (before)
// CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: java.lang.Class Main.dontInlineOtherDexClassStaticCall() inliner (after)
// CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
public static Class dontInlineOtherDexClassStaticCall() {
return OtherDex.returnOtherDexClassStaticCall();
@@ -139,14 +140,15 @@
// CHECK-START: java.lang.Class Main.inlineOtherDexCallingMain() inliner (before)
// CHECK-DAG: <<Invoke:l\d+>> InvokeStaticOrDirect
- // CHECK-DAG: Return [ <<Invoke>> ]
+ // CHECK-DAG: Return [<<Invoke>>]
// CHECK-START: java.lang.Class Main.inlineOtherDexCallingMain() inliner (after)
// CHECK-NOT: InvokeStaticOrDirect
// CHECK-START: java.lang.Class Main.inlineOtherDexCallingMain() inliner (after)
- // CHECK-DAG: <<Class:l\d+>> LoadClass
- // CHECK-DAG: Return [ <<Class>> ]
+ // CHECK-DAG: Return [<<Class:l\d+>>]
+ // CHECK-DAG: <<Class>> LoadClass
+ // Note: Verify backwards because there are two LoadClass instructions
public static Class inlineOtherDexCallingMain() {
return OtherDex.returnOtherDexCallingMain();