< prev index next >

test/compiler/intrinsics/bmi/TestAndnI.java

Print this page
rev 8994 : 8134579: [TESTBUG] Some bmi tests fail if can_access_local_variables is on.
Summary: Others fail because of uncommon trap. Also fix test file names.

@@ -59,36 +59,60 @@
         public int intExpr(int src1, int src2) {
             return ~src1 & src2;
         }
 
         public int intExpr(int src1, Expr.MemI src2) {
+            if (src2 != null) {
             return ~src1 & src2.value;
+            } else {
+                return 0;
+            }
         }
 
         public int intExpr(Expr.MemI src1, int src2) {
+            if (src1 != null) {
             return ~src1.value & src2;
+            } else {
+                return 0;
+            }
         }
 
         public int intExpr(Expr.MemI src1, Expr.MemI src2) {
+            if (src1 != null && src2 != null) {
             return ~src1.value & src2.value;
+            } else {
+                return 0;
+            }
         }
     }
 
     public static class AndnICommutativeExpr extends Expr.BMIBinaryIntExpr {
 
         public int intExpr(int src1, int src2) {
             return src1 & ~src2;
         }
 
         public int intExpr(int src1, Expr.MemI src2) {
+            if (src2 != null) {
             return src1 & ~src2.value;
+            } else {
+                return 0;
+            }
         }
 
         public int intExpr(Expr.MemI src1, int src2) {
+            if (src1 != null) {
             return src1.value & ~src2;
+            } else {
+                return 0;
+            }
         }
 
         public int intExpr(Expr.MemI src1, Expr.MemI src2) {
+            if (src1 != null && src2 != null) {
             return src1.value & ~src2.value;
+            } else {
+                return 0;
+            }
         }
     }
 }
< prev index next >