From a06d66a4ee60926127b9498b7ff0b3e37a24fccf Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Thu, 28 May 2015 11:14:54 +0100 Subject: 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 --- test/463-checker-boolean-simplifier/src/Main.java | 214 +++++++++++----------- 1 file changed, 107 insertions(+), 107 deletions(-) (limited to 'test/463-checker-boolean-simplifier/src') diff --git a/test/463-checker-boolean-simplifier/src/Main.java b/test/463-checker-boolean-simplifier/src/Main.java index e2374480c6..0b75930146 100644 --- a/test/463-checker-boolean-simplifier/src/Main.java +++ b/test/463-checker-boolean-simplifier/src/Main.java @@ -37,33 +37,33 @@ public class Main { * empty branches removed. */ - // CHECK-START: boolean Main.BooleanNot(boolean) boolean_simplifier (before) - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> IntConstant 0 - // CHECK-DAG: <> IntConstant 1 - // CHECK-DAG: If [<>] - // CHECK-DAG: <> Phi [<>,<>] - // CHECK-DAG: Return [<>] - - // 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: <> ParameterValue - // CHECK-DAG: <> IntConstant 0 - // CHECK-DAG: <> BooleanNot [<>] - // CHECK-DAG: Return [<>] - - // 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 (before) + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> IntConstant 0 + /// CHECK-DAG: <> IntConstant 1 + /// CHECK-DAG: If [<>] + /// CHECK-DAG: <> Phi [<>,<>] + /// CHECK-DAG: Return [<>] + + /// 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: <> ParameterValue + /// CHECK-DAG: <> IntConstant 0 + /// CHECK-DAG: <> BooleanNot [<>] + /// CHECK-DAG: Return [<>] + + /// 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 public static boolean BooleanNot(boolean x) { return !x; @@ -74,23 +74,23 @@ public class Main { * and 0 when False. */ - // CHECK-START: boolean Main.GreaterThan(int, int) boolean_simplifier (before) - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> IntConstant 0 - // CHECK-DAG: <> IntConstant 1 - // CHECK-DAG: <> GreaterThan [<>,<>] - // CHECK-DAG: If [<>] - // CHECK-DAG: <> Phi [<>,<>] - // CHECK-DAG: Return [<>] - - // CHECK-START: boolean Main.GreaterThan(int, int) boolean_simplifier (after) - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> IntConstant 0 - // CHECK-DAG: <> IntConstant 1 - // CHECK-DAG: <> GreaterThan [<>,<>] - // CHECK-DAG: Return [<>] + /// CHECK-START: boolean Main.GreaterThan(int, int) boolean_simplifier (before) + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> IntConstant 0 + /// CHECK-DAG: <> IntConstant 1 + /// CHECK-DAG: <> GreaterThan [<>,<>] + /// CHECK-DAG: If [<>] + /// CHECK-DAG: <> Phi [<>,<>] + /// CHECK-DAG: Return [<>] + + /// CHECK-START: boolean Main.GreaterThan(int, int) boolean_simplifier (after) + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> IntConstant 0 + /// CHECK-DAG: <> IntConstant 1 + /// CHECK-DAG: <> GreaterThan [<>,<>] + /// CHECK-DAG: Return [<>] public static boolean GreaterThan(int x, int y) { return (x <= y) ? false : true; @@ -101,26 +101,26 @@ public class Main { * and 1 when False. */ - // CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (before) - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> IntConstant 0 - // CHECK-DAG: <> IntConstant 1 - // CHECK-DAG: <> GreaterThanOrEqual [<>,<>] - // CHECK-DAG: If [<>] - // CHECK-DAG: <> Phi [<>,<>] - // CHECK-DAG: Return [<>] - - // CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (after) - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> IntConstant 0 - // CHECK-DAG: <> IntConstant 1 - // CHECK-DAG: <> LessThan [<>,<>] - // CHECK-DAG: Return [<>] - - // CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (after) - // CHECK-NOT: GreaterThanOrEqual + /// CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (before) + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> IntConstant 0 + /// CHECK-DAG: <> IntConstant 1 + /// CHECK-DAG: <> GreaterThanOrEqual [<>,<>] + /// CHECK-DAG: If [<>] + /// CHECK-DAG: <> Phi [<>,<>] + /// CHECK-DAG: Return [<>] + + /// CHECK-START: boolean Main.LessThan(int, int) boolean_simplifier (after) + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> IntConstant 0 + /// CHECK-DAG: <> IntConstant 1 + /// CHECK-DAG: <> LessThan [<>,<>] + /// CHECK-DAG: Return [<>] + + /// 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 @@ public class Main { * Note that Phis are discovered retrospectively. */ - // CHECK-START: boolean Main.ValuesOrdered(int, int, int) boolean_simplifier (before) - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> IntConstant 0 - // CHECK-DAG: <> IntConstant 1 - // CHECK-DAG: <> GreaterThan [<>,<>] - // CHECK-DAG: If [<>] - // CHECK-DAG: <> GreaterThan [<>,<>] - // CHECK-DAG: If [<>] - // CHECK-DAG: <> NotEqual [<>,<>] - // CHECK-DAG: If [<>] - // CHECK-DAG: Return [<>] - // CHECK-DAG: <> Phi [<>,<>] - // CHECK-DAG: <> Phi [<>,<>] - // CHECK-DAG: <> Phi [<>,<>] - - // CHECK-START: boolean Main.ValuesOrdered(int, int, int) boolean_simplifier (after) - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> LessThanOrEqual [<>,<>] - // CHECK-DAG: <> LessThanOrEqual [<>,<>] - // CHECK-DAG: <> Equal [<>,<>] - // CHECK-DAG: Return [<>] + /// CHECK-START: boolean Main.ValuesOrdered(int, int, int) boolean_simplifier (before) + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> IntConstant 0 + /// CHECK-DAG: <> IntConstant 1 + /// CHECK-DAG: <> GreaterThan [<>,<>] + /// CHECK-DAG: If [<>] + /// CHECK-DAG: <> GreaterThan [<>,<>] + /// CHECK-DAG: If [<>] + /// CHECK-DAG: <> NotEqual [<>,<>] + /// CHECK-DAG: If [<>] + /// CHECK-DAG: Return [<>] + /// CHECK-DAG: <> Phi [<>,<>] + /// CHECK-DAG: <> Phi [<>,<>] + /// CHECK-DAG: <> Phi [<>,<>] + + /// CHECK-START: boolean Main.ValuesOrdered(int, int, int) boolean_simplifier (after) + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> LessThanOrEqual [<>,<>] + /// CHECK-DAG: <> LessThanOrEqual [<>,<>] + /// CHECK-DAG: <> Equal [<>,<>] + /// CHECK-DAG: Return [<>] 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: <> ParameterValue - // CHECK-DAG: <> IntConstant 42 - // CHECK-DAG: <> IntConstant 43 - // CHECK-DAG: <> BooleanNot [<>] - // CHECK-DAG: If [<>] - // CHECK-DAG: <> Phi [<>,<>] - // CHECK-DAG: Return [<>] - - // CHECK-START: int Main.NegatedCondition(boolean) boolean_simplifier (after) - // CHECK-DAG: <> ParameterValue - // CHECK-DAG: <> IntConstant 42 - // CHECK-DAG: <> IntConstant 43 - // CHECK-DAG: If [<>] - // CHECK-DAG: <> Phi [<>,<>] - // CHECK-DAG: Return [<>] + /// CHECK-START: int Main.NegatedCondition(boolean) boolean_simplifier (before) + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> IntConstant 42 + /// CHECK-DAG: <> IntConstant 43 + /// CHECK-DAG: <> BooleanNot [<>] + /// CHECK-DAG: If [<>] + /// CHECK-DAG: <> Phi [<>,<>] + /// CHECK-DAG: Return [<>] + + /// CHECK-START: int Main.NegatedCondition(boolean) boolean_simplifier (after) + /// CHECK-DAG: <> ParameterValue + /// CHECK-DAG: <> IntConstant 42 + /// CHECK-DAG: <> IntConstant 43 + /// CHECK-DAG: If [<>] + /// CHECK-DAG: <> Phi [<>,<>] + /// CHECK-DAG: Return [<>] // 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) { -- cgit v1.2.3-59-g8ed1b