ART: Distinguish Checker lines from comments
In order to prevent tests passing due to lines with hard-to-spot
formatting errors begin ignored, e.g. by forgetting the colon after
"//CHECK", Checker will now require its assertions to start with "///"
or "##", respectivelly for Java and Smali. Such lines will never be
ignored and will fail the test unless successfully parsed.
Change-Id: I0da9a8f13eb96d950af8c85df17d1899a853a299
diff --git a/test/463-checker-boolean-simplifier/src/Main.java b/test/463-checker-boolean-simplifier/src/Main.java
index e237448..0b75930 100644
--- a/test/463-checker-boolean-simplifier/src/Main.java
+++ b/test/463-checker-boolean-simplifier/src/Main.java
@@ -37,33 +37,33 @@
* empty branches removed.
*/
- // CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (before)
- // CHECK-DAG: <<Param:z\d+>> ParameterValue
- // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
- // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
- // CHECK-DAG: If [<<Param>>]
- // CHECK-DAG: <<Phi:i\d+>> Phi [<<Const1>>,<<Const0>>]
- // CHECK-DAG: Return [<<Phi>>]
+ /// CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (before)
+ /// CHECK-DAG: <<Param:z\d+>> ParameterValue
+ /// CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ /// CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ /// CHECK-DAG: If [<<Param>>]
+ /// CHECK-DAG: <<Phi:i\d+>> Phi [<<Const1>>,<<Const0>>]
+ /// CHECK-DAG: Return [<<Phi>>]
- // CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (before)
- // CHECK: Goto
- // CHECK: Goto
- // CHECK: Goto
- // CHECK-NOT: Goto
+ /// CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (before)
+ /// CHECK: Goto
+ /// CHECK: Goto
+ /// CHECK: Goto
+ /// CHECK-NOT: Goto
- // CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (after)
- // CHECK-DAG: <<Param:z\d+>> ParameterValue
- // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
- // CHECK-DAG: <<NotParam:z\d+>> BooleanNot [<<Param>>]
- // CHECK-DAG: Return [<<NotParam>>]
+ /// CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (after)
+ /// CHECK-DAG: <<Param:z\d+>> ParameterValue
+ /// CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ /// CHECK-DAG: <<NotParam:z\d+>> BooleanNot [<<Param>>]
+ /// CHECK-DAG: Return [<<NotParam>>]
- // CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (after)
- // CHECK-NOT: If
- // CHECK-NOT: Phi
+ /// CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (after)
+ /// CHECK-NOT: If
+ /// CHECK-NOT: Phi
- // CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (after)
- // CHECK: Goto
- // CHECK-NOT: Goto
+ /// CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (after)
+ /// CHECK: Goto
+ /// CHECK-NOT: Goto
public static boolean BooleanNot(boolean x) {
return !x;
@@ -74,23 +74,23 @@
* and 0 when False.
*/
- // CHECK-START: boolean Main.GreaterThan(int, int) boolean_simplifier (before)
- // CHECK-DAG: <<ParamX:i\d+>> ParameterValue
- // CHECK-DAG: <<ParamY:i\d+>> ParameterValue
- // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
- // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
- // CHECK-DAG: <<Cond:z\d+>> GreaterThan [<<ParamX>>,<<ParamY>>]
- // CHECK-DAG: If [<<Cond>>]
- // CHECK-DAG: <<Phi:i\d+>> Phi [<<Const0>>,<<Const1>>]
- // CHECK-DAG: Return [<<Phi>>]
+ /// CHECK-START: boolean Main.GreaterThan(int, int) boolean_simplifier (before)
+ /// CHECK-DAG: <<ParamX:i\d+>> ParameterValue
+ /// CHECK-DAG: <<ParamY:i\d+>> ParameterValue
+ /// CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ /// CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ /// CHECK-DAG: <<Cond:z\d+>> GreaterThan [<<ParamX>>,<<ParamY>>]
+ /// CHECK-DAG: If [<<Cond>>]
+ /// CHECK-DAG: <<Phi:i\d+>> Phi [<<Const0>>,<<Const1>>]
+ /// CHECK-DAG: Return [<<Phi>>]
- // CHECK-START: boolean Main.GreaterThan(int, int) boolean_simplifier (after)
- // CHECK-DAG: <<ParamX:i\d+>> ParameterValue
- // CHECK-DAG: <<ParamY:i\d+>> ParameterValue
- // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
- // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
- // CHECK-DAG: <<Cond:z\d+>> GreaterThan [<<ParamX>>,<<ParamY>>]
- // CHECK-DAG: Return [<<Cond>>]
+ /// CHECK-START: boolean Main.GreaterThan(int, int) boolean_simplifier (after)
+ /// CHECK-DAG: <<ParamX:i\d+>> ParameterValue
+ /// CHECK-DAG: <<ParamY:i\d+>> ParameterValue
+ /// CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ /// CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ /// CHECK-DAG: <<Cond:z\d+>> GreaterThan [<<ParamX>>,<<ParamY>>]
+ /// CHECK-DAG: Return [<<Cond>>]
public static boolean GreaterThan(int x, int y) {
return (x <= y) ? false : true;
@@ -101,26 +101,26 @@
* and 1 when False.
*/
- // CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (before)
- // CHECK-DAG: <<ParamX:i\d+>> ParameterValue
- // CHECK-DAG: <<ParamY:i\d+>> ParameterValue
- // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
- // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
- // CHECK-DAG: <<Cond:z\d+>> GreaterThanOrEqual [<<ParamX>>,<<ParamY>>]
- // CHECK-DAG: If [<<Cond>>]
- // CHECK-DAG: <<Phi:i\d+>> Phi [<<Const1>>,<<Const0>>]
- // CHECK-DAG: Return [<<Phi>>]
+ /// CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (before)
+ /// CHECK-DAG: <<ParamX:i\d+>> ParameterValue
+ /// CHECK-DAG: <<ParamY:i\d+>> ParameterValue
+ /// CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ /// CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ /// CHECK-DAG: <<Cond:z\d+>> GreaterThanOrEqual [<<ParamX>>,<<ParamY>>]
+ /// CHECK-DAG: If [<<Cond>>]
+ /// CHECK-DAG: <<Phi:i\d+>> Phi [<<Const1>>,<<Const0>>]
+ /// CHECK-DAG: Return [<<Phi>>]
- // CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (after)
- // CHECK-DAG: <<ParamX:i\d+>> ParameterValue
- // CHECK-DAG: <<ParamY:i\d+>> ParameterValue
- // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
- // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
- // CHECK-DAG: <<Cond:z\d+>> LessThan [<<ParamX>>,<<ParamY>>]
- // CHECK-DAG: Return [<<Cond>>]
+ /// CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (after)
+ /// CHECK-DAG: <<ParamX:i\d+>> ParameterValue
+ /// CHECK-DAG: <<ParamY:i\d+>> ParameterValue
+ /// CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ /// CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ /// CHECK-DAG: <<Cond:z\d+>> LessThan [<<ParamX>>,<<ParamY>>]
+ /// CHECK-DAG: Return [<<Cond>>]
- // CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (after)
- // CHECK-NOT: GreaterThanOrEqual
+ /// CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (after)
+ /// CHECK-NOT: GreaterThanOrEqual
public static boolean LessThan(int x, int y) {
return (x < y) ? true : false;
@@ -131,57 +131,57 @@
* Note that Phis are discovered retrospectively.
*/
- // CHECK-START: boolean Main.ValuesOrdered(int, int, int) boolean_simplifier (before)
- // CHECK-DAG: <<ParamX:i\d+>> ParameterValue
- // CHECK-DAG: <<ParamY:i\d+>> ParameterValue
- // CHECK-DAG: <<ParamZ:i\d+>> ParameterValue
- // CHECK-DAG: <<Const0:i\d+>> IntConstant 0
- // CHECK-DAG: <<Const1:i\d+>> IntConstant 1
- // CHECK-DAG: <<CondXY:z\d+>> GreaterThan [<<ParamX>>,<<ParamY>>]
- // CHECK-DAG: If [<<CondXY>>]
- // CHECK-DAG: <<CondYZ:z\d+>> GreaterThan [<<ParamY>>,<<ParamZ>>]
- // CHECK-DAG: If [<<CondYZ>>]
- // CHECK-DAG: <<CondXYZ:z\d+>> NotEqual [<<PhiXY:i\d+>>,<<PhiYZ:i\d+>>]
- // CHECK-DAG: If [<<CondXYZ>>]
- // CHECK-DAG: Return [<<PhiXYZ:i\d+>>]
- // CHECK-DAG: <<PhiXY>> Phi [<<Const1>>,<<Const0>>]
- // CHECK-DAG: <<PhiYZ>> Phi [<<Const1>>,<<Const0>>]
- // CHECK-DAG: <<PhiXYZ>> Phi [<<Const1>>,<<Const0>>]
+ /// CHECK-START: boolean Main.ValuesOrdered(int, int, int) boolean_simplifier (before)
+ /// CHECK-DAG: <<ParamX:i\d+>> ParameterValue
+ /// CHECK-DAG: <<ParamY:i\d+>> ParameterValue
+ /// CHECK-DAG: <<ParamZ:i\d+>> ParameterValue
+ /// CHECK-DAG: <<Const0:i\d+>> IntConstant 0
+ /// CHECK-DAG: <<Const1:i\d+>> IntConstant 1
+ /// CHECK-DAG: <<CondXY:z\d+>> GreaterThan [<<ParamX>>,<<ParamY>>]
+ /// CHECK-DAG: If [<<CondXY>>]
+ /// CHECK-DAG: <<CondYZ:z\d+>> GreaterThan [<<ParamY>>,<<ParamZ>>]
+ /// CHECK-DAG: If [<<CondYZ>>]
+ /// CHECK-DAG: <<CondXYZ:z\d+>> NotEqual [<<PhiXY:i\d+>>,<<PhiYZ:i\d+>>]
+ /// CHECK-DAG: If [<<CondXYZ>>]
+ /// CHECK-DAG: Return [<<PhiXYZ:i\d+>>]
+ /// CHECK-DAG: <<PhiXY>> Phi [<<Const1>>,<<Const0>>]
+ /// CHECK-DAG: <<PhiYZ>> Phi [<<Const1>>,<<Const0>>]
+ /// CHECK-DAG: <<PhiXYZ>> Phi [<<Const1>>,<<Const0>>]
- // CHECK-START: boolean Main.ValuesOrdered(int, int, int) boolean_simplifier (after)
- // CHECK-DAG: <<ParamX:i\d+>> ParameterValue
- // CHECK-DAG: <<ParamY:i\d+>> ParameterValue
- // CHECK-DAG: <<ParamZ:i\d+>> ParameterValue
- // CHECK-DAG: <<CmpXY:z\d+>> LessThanOrEqual [<<ParamX>>,<<ParamY>>]
- // CHECK-DAG: <<CmpYZ:z\d+>> LessThanOrEqual [<<ParamY>>,<<ParamZ>>]
- // CHECK-DAG: <<CmpXYZ:z\d+>> Equal [<<CmpXY>>,<<CmpYZ>>]
- // CHECK-DAG: Return [<<CmpXYZ>>]
+ /// CHECK-START: boolean Main.ValuesOrdered(int, int, int) boolean_simplifier (after)
+ /// CHECK-DAG: <<ParamX:i\d+>> ParameterValue
+ /// CHECK-DAG: <<ParamY:i\d+>> ParameterValue
+ /// CHECK-DAG: <<ParamZ:i\d+>> ParameterValue
+ /// CHECK-DAG: <<CmpXY:z\d+>> LessThanOrEqual [<<ParamX>>,<<ParamY>>]
+ /// CHECK-DAG: <<CmpYZ:z\d+>> LessThanOrEqual [<<ParamY>>,<<ParamZ>>]
+ /// CHECK-DAG: <<CmpXYZ:z\d+>> Equal [<<CmpXY>>,<<CmpYZ>>]
+ /// CHECK-DAG: Return [<<CmpXYZ>>]
public static boolean ValuesOrdered(int x, int y, int z) {
return (x <= y) == (y <= z);
}
- // CHECK-START: int Main.NegatedCondition(boolean) boolean_simplifier (before)
- // CHECK-DAG: <<Param:z\d+>> ParameterValue
- // CHECK-DAG: <<Const42:i\d+>> IntConstant 42
- // CHECK-DAG: <<Const43:i\d+>> IntConstant 43
- // CHECK-DAG: <<NotParam:z\d+>> BooleanNot [<<Param>>]
- // CHECK-DAG: If [<<NotParam>>]
- // CHECK-DAG: <<Phi:i\d+>> Phi [<<Const42>>,<<Const43>>]
- // CHECK-DAG: Return [<<Phi>>]
+ /// CHECK-START: int Main.NegatedCondition(boolean) boolean_simplifier (before)
+ /// CHECK-DAG: <<Param:z\d+>> ParameterValue
+ /// CHECK-DAG: <<Const42:i\d+>> IntConstant 42
+ /// CHECK-DAG: <<Const43:i\d+>> IntConstant 43
+ /// CHECK-DAG: <<NotParam:z\d+>> BooleanNot [<<Param>>]
+ /// CHECK-DAG: If [<<NotParam>>]
+ /// CHECK-DAG: <<Phi:i\d+>> Phi [<<Const42>>,<<Const43>>]
+ /// CHECK-DAG: Return [<<Phi>>]
- // CHECK-START: int Main.NegatedCondition(boolean) boolean_simplifier (after)
- // CHECK-DAG: <<Param:z\d+>> ParameterValue
- // CHECK-DAG: <<Const42:i\d+>> IntConstant 42
- // CHECK-DAG: <<Const43:i\d+>> IntConstant 43
- // CHECK-DAG: If [<<Param>>]
- // CHECK-DAG: <<Phi:i\d+>> Phi [<<Const42>>,<<Const43>>]
- // CHECK-DAG: Return [<<Phi>>]
+ /// CHECK-START: int Main.NegatedCondition(boolean) boolean_simplifier (after)
+ /// CHECK-DAG: <<Param:z\d+>> ParameterValue
+ /// CHECK-DAG: <<Const42:i\d+>> IntConstant 42
+ /// CHECK-DAG: <<Const43:i\d+>> IntConstant 43
+ /// CHECK-DAG: If [<<Param>>]
+ /// CHECK-DAG: <<Phi:i\d+>> Phi [<<Const42>>,<<Const43>>]
+ /// CHECK-DAG: Return [<<Phi>>]
// Note: The fact that branches are swapped is verified by running the test.
- // CHECK-START: int Main.NegatedCondition(boolean) boolean_simplifier (after)
- // CHECK-NOT: BooleanNot
+ /// CHECK-START: int Main.NegatedCondition(boolean) boolean_simplifier (after)
+ /// CHECK-NOT: BooleanNot
public static int NegatedCondition(boolean x) {
if (x != false) {