Update if simplification based on ranges.
When one of the ranges represents a single value there are simplification
posibilities at the edges of the other interval.
[s, e] < s -> always false
[s, e] >= s -> always true
[s, e] > e -> always false
[s, e] <= e -> always true
R=christofferqa@google.com
Bug: 111736519
Change-Id: Ic15d40dfda410f065cf6205d7a91b4a9624bd0b2
diff --git a/src/test/examples/assumevalues6/Assumevalues.java b/src/test/examples/assumevalues6/Assumevalues.java
new file mode 100644
index 0000000..b3ad1de
--- /dev/null
+++ b/src/test/examples/assumevalues6/Assumevalues.java
@@ -0,0 +1,45 @@
+// Copyright (c) 2018 the R8 project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+package assumevalues6;
+
+public class Assumevalues {
+ public static int field = 0;
+ public static int field2 = 2;
+ public static int field3 = 2;
+
+ public static void main(String[] args) {
+ if (0 > field) {
+ System.out.println("NOPE1");
+ }
+ if (field < 0) {
+ System.out.println("NOPE2");
+ }
+ if (field3 == 0) {
+ System.out.println("NOPE3");
+ }
+ if (field3 != 0) {
+ System.out.println("YUP1");
+ }
+ if (2 < field) {
+ System.out.println("NOPE4");
+ }
+ if (field > 2) {
+ System.out.println("NOPE5");
+ }
+ if (field2 < field) {
+ System.out.println("NOPE6");
+ }
+ if (field > field2) {
+ System.out.println("NOPE7");
+ }
+ if (field <= field2) {
+ System.out.println("YUP2");
+ }
+ if (field2 >= field) {
+ System.out.println("YUP3");
+ }
+ System.out.println("OK");
+ }
+}