1 /*
   2  * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test TestNewAcmp
  26  * @summary Verifies correctness of the new acmp bytecode.
  27  * @library /testlibrary /test/lib /compiler/whitebox /
  28  * @compile TestNewAcmp.java
  29  * @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox
  30  * @run main/othervm/timeout=300 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
  31  *                               compiler.valhalla.inlinetypes.TestNewAcmp
  32  */
  33 
  34 package compiler.valhalla.inlinetypes;
  35 
  36 import compiler.lib.ir_framework.CompLevel;
  37 import compiler.lib.ir_framework.TestFramework;
  38 import jdk.test.lib.Asserts;
  39 import jdk.test.lib.process.ProcessTools;
  40 import jdk.test.lib.process.OutputAnalyzer;
  41 import java.lang.annotation.Retention;
  42 import java.lang.annotation.RetentionPolicy;
  43 import java.lang.invoke.*;
  44 import java.lang.reflect.Method;
  45 import java.util.regex.Pattern;
  46 import java.util.regex.Matcher;
  47 import java.util.ArrayList;
  48 import java.util.Arrays;
  49 import java.util.List;
  50 import sun.hotspot.WhiteBox;
  51 
  52 
  53 interface MyInterface {
  54 
  55 }
  56 
  57 abstract class MyAbstract implements MyInterface {
  58 
  59 
  60 }
  61 
  62 primitive class MyValue1 extends MyAbstract {
  63     final int x;
  64 
  65     MyValue1(int x) {
  66         this.x = x;
  67     }
  68 
  69     static MyValue1 createDefault() {
  70         return MyValue1.default;
  71     }
  72 
  73     static MyValue1 setX(MyValue1 v, int x) {
  74         return new MyValue1(x);
  75     }
  76 }
  77 
  78 primitive class MyValue2 extends MyAbstract {
  79     final int x;
  80 
  81     MyValue2(int x) {
  82         this.x = x;
  83     }
  84 
  85     static MyValue2 createDefault() {
  86         return MyValue2.default;
  87     }
  88 
  89     static MyValue2 setX(MyValue2 v, int x) {
  90         return new MyValue2(x);
  91     }
  92 }
  93 
  94 class MyObject extends MyAbstract {
  95     int x;
  96 }
  97 
  98 // Mark test methods that return false if the argument is null
  99 @Retention(RetentionPolicy.RUNTIME)
 100 @interface FalseIfNull { }
 101 
 102 // Mark test methods that return true if the argument is null
 103 @Retention(RetentionPolicy.RUNTIME)
 104 @interface TrueIfNull { }
 105 
 106 public class TestNewAcmp {
 107 
 108     public boolean testEq01_1(Object u1, Object u2) {
 109         return get(u1) == u2; // new acmp
 110     }
 111 
 112     public boolean testEq01_2(Object u1, Object u2) {
 113         return u1 == get(u2); // new acmp
 114     }
 115 
 116     public boolean testEq01_3(Object u1, Object u2) {
 117         return get(u1) == get(u2); // new acmp
 118     }
 119 
 120     @FalseIfNull
 121     public boolean testEq01_4(Object u1, Object u2) {
 122         return getNotNull(u1) == u2; // new acmp without null check
 123     }
 124 
 125     @FalseIfNull
 126     public boolean testEq01_5(Object u1, Object u2) {
 127         return u1 == getNotNull(u2); // new acmp without null check
 128     }
 129 
 130     @FalseIfNull
 131     public boolean testEq01_6(Object u1, Object u2) {
 132         return getNotNull(u1) == getNotNull(u2); // new acmp without null check
 133     }
 134 
 135     public boolean testEq02_1(MyValue1 v1, MyValue1 v2) {
 136         return get(v1) == (Object)v2; // only true if both null
 137     }
 138 
 139     public boolean testEq02_2(MyValue1 v1, MyValue1 v2) {
 140         return (Object)v1 == get(v2); // only true if both null
 141     }
 142 
 143     public boolean testEq02_3(MyValue1 v1, MyValue1 v2) {
 144         return get(v1) == get(v2); // only true if both null
 145     }
 146 
 147     public boolean testEq03_1(MyValue1 v, Object u) {
 148         return get(v) == u; // only true if both null
 149     }
 150 
 151     public boolean testEq03_2(MyValue1 v, Object u) {
 152         return (Object)v == get(u); // only true if both null
 153     }
 154 
 155     public boolean testEq03_3(MyValue1 v, Object u) {
 156         return get(v) == get(u); // only true if both null
 157     }
 158 
 159     public boolean testEq04_1(Object u, MyValue1 v) {
 160         return get(u) == (Object)v; // only true if both null
 161     }
 162 
 163     public boolean testEq04_2(Object u, MyValue1 v) {
 164         return u == get(v); // only true if both null
 165     }
 166 
 167     public boolean testEq04_3(Object u, MyValue1 v) {
 168         return get(u) == get(v); // only true if both null
 169     }
 170 
 171     public boolean testEq05_1(MyObject o, MyValue1 v) {
 172         return get(o) == (Object)v; // only true if both null
 173     }
 174 
 175     public boolean testEq05_2(MyObject o, MyValue1 v) {
 176         return o == get(v); // only true if both null
 177     }
 178 
 179     public boolean testEq05_3(MyObject o, MyValue1 v) {
 180         return get(o) == get(v); // only true if both null
 181     }
 182 
 183     public boolean testEq06_1(MyValue1 v, MyObject o) {
 184         return get(v) == o; // only true if both null
 185     }
 186 
 187     public boolean testEq06_2(MyValue1 v, MyObject o) {
 188         return (Object)v == get(o); // only true if both null
 189     }
 190 
 191     public boolean testEq06_3(MyValue1 v, MyObject o) {
 192         return get(v) == get(o); // only true if both null
 193     }
 194 
 195     public boolean testEq07_1(MyValue1 v1, MyValue1 v2) {
 196         return getNotNull(v1) == (Object)v2; // false
 197     }
 198 
 199     public boolean testEq07_2(MyValue1 v1, MyValue1 v2) {
 200         return (Object)v1 == getNotNull(v2); // false
 201     }
 202 
 203     public boolean testEq07_3(MyValue1 v1, MyValue1 v2) {
 204         return getNotNull(v1) == getNotNull(v2); // false
 205     }
 206 
 207     public boolean testEq08_1(MyValue1 v, Object u) {
 208         return getNotNull(v) == u; // false
 209     }
 210 
 211     public boolean testEq08_2(MyValue1 v, Object u) {
 212         return (Object)v == getNotNull(u); // false
 213     }
 214 
 215     public boolean testEq08_3(MyValue1 v, Object u) {
 216         return getNotNull(v) == getNotNull(u); // false
 217     }
 218 
 219     public boolean testEq09_1(Object u, MyValue1 v) {
 220         return getNotNull(u) == (Object)v; // false
 221     }
 222 
 223     public boolean testEq09_2(Object u, MyValue1 v) {
 224         return u == getNotNull(v); // false
 225     }
 226 
 227     public boolean testEq09_3(Object u, MyValue1 v) {
 228         return getNotNull(u) == getNotNull(v); // false
 229     }
 230 
 231     public boolean testEq10_1(MyObject o, MyValue1 v) {
 232         return getNotNull(o) == (Object)v; // false
 233     }
 234 
 235     public boolean testEq10_2(MyObject o, MyValue1 v) {
 236         return o == getNotNull(v); // false
 237     }
 238 
 239     public boolean testEq10_3(MyObject o, MyValue1 v) {
 240         return getNotNull(o) == getNotNull(v); // false
 241     }
 242 
 243     public boolean testEq11_1(MyValue1 v, MyObject o) {
 244         return getNotNull(v) == o; // false
 245     }
 246 
 247     public boolean testEq11_2(MyValue1 v, MyObject o) {
 248         return (Object)v == getNotNull(o); // false
 249     }
 250 
 251     public boolean testEq11_3(MyValue1 v, MyObject o) {
 252         return getNotNull(v) == getNotNull(o); // false
 253     }
 254 
 255     public boolean testEq12_1(MyObject o1, MyObject o2) {
 256         return get(o1) == o2; // old acmp
 257     }
 258 
 259     public boolean testEq12_2(MyObject o1, MyObject o2) {
 260         return o1 == get(o2); // old acmp
 261     }
 262 
 263     public boolean testEq12_3(MyObject o1, MyObject o2) {
 264         return get(o1) == get(o2); // old acmp
 265     }
 266 
 267     public boolean testEq13_1(Object u, MyObject o) {
 268         return get(u) == o; // old acmp
 269     }
 270 
 271     public boolean testEq13_2(Object u, MyObject o) {
 272         return u == get(o); // old acmp
 273     }
 274 
 275     public boolean testEq13_3(Object u, MyObject o) {
 276         return get(u) == get(o); // old acmp
 277     }
 278 
 279     public boolean testEq14_1(MyObject o, Object u) {
 280         return get(o) == u; // old acmp
 281     }
 282 
 283     public boolean testEq14_2(MyObject o, Object u) {
 284         return o == get(u); // old acmp
 285     }
 286 
 287     public boolean testEq14_3(MyObject o, Object u) {
 288         return get(o) == get(u); // old acmp
 289     }
 290 
 291     public boolean testEq15_1(Object[] a, Object u) {
 292         return get(a) == u; // old acmp
 293     }
 294 
 295     public boolean testEq15_2(Object[] a, Object u) {
 296         return a == get(u); // old acmp
 297     }
 298 
 299     public boolean testEq15_3(Object[] a, Object u) {
 300         return get(a) == get(u); // old acmp
 301     }
 302 
 303     public boolean testEq16_1(Object u, Object[] a) {
 304         return get(u) == a; // old acmp
 305     }
 306 
 307     public boolean testEq16_2(Object u, Object[] a) {
 308         return u == get(a); // old acmp
 309     }
 310 
 311     public boolean testEq16_3(Object u, Object[] a) {
 312         return get(u) == get(a); // old acmp
 313     }
 314 
 315     public boolean testEq17_1(Object[] a, MyValue1 v) {
 316         return get(a) == (Object)v; // only true if both null
 317     }
 318 
 319     public boolean testEq17_2(Object[] a, MyValue1 v) {
 320         return a == get(v); // only true if both null
 321     }
 322 
 323     public boolean testEq17_3(Object[] a, MyValue1 v) {
 324         return get(a) == get(v); // only true if both null
 325     }
 326 
 327     public boolean testEq18_1(MyValue1 v, Object[] a) {
 328         return get(v) == a; // only true if both null
 329     }
 330 
 331     public boolean testEq18_2(MyValue1 v, Object[] a) {
 332         return (Object)v == get(a); // only true if both null
 333     }
 334 
 335     public boolean testEq18_3(MyValue1 v, Object[] a) {
 336         return get(v) == get(a); // only true if both null
 337     }
 338 
 339     public boolean testEq19_1(Object[] a, MyValue1 v) {
 340         return getNotNull(a) == (Object)v; // false
 341     }
 342 
 343     public boolean testEq19_2(Object[] a, MyValue1 v) {
 344         return a == getNotNull(v); // false
 345     }
 346 
 347     public boolean testEq19_3(Object[] a, MyValue1 v) {
 348         return getNotNull(a) == getNotNull(v); // false
 349     }
 350 
 351     public boolean testEq20_1(MyValue1 v, Object[] a) {
 352         return getNotNull(v) == a; // false
 353     }
 354 
 355     public boolean testEq20_2(MyValue1 v, Object[] a) {
 356         return (Object)v == getNotNull(a); // false
 357     }
 358 
 359     public boolean testEq20_3(MyValue1 v, Object[] a) {
 360         return getNotNull(v) == getNotNull(a); // false
 361     }
 362 
 363     public boolean testEq21_1(MyInterface u1, MyInterface u2) {
 364         return get(u1) == u2; // new acmp
 365     }
 366 
 367     public boolean testEq21_2(MyInterface u1, MyInterface u2) {
 368         return u1 == get(u2); // new acmp
 369     }
 370 
 371     public boolean testEq21_3(MyInterface u1, MyInterface u2) {
 372         return get(u1) == get(u2); // new acmp
 373     }
 374 
 375     @FalseIfNull
 376     public boolean testEq21_4(MyInterface u1, MyInterface u2) {
 377         return getNotNull(u1) == u2; // new acmp without null check
 378     }
 379 
 380     @FalseIfNull
 381     public boolean testEq21_5(MyInterface u1, MyInterface u2) {
 382         return u1 == getNotNull(u2); // new acmp without null check
 383     }
 384 
 385     @FalseIfNull
 386     public boolean testEq21_6(MyInterface u1, MyInterface u2) {
 387         return getNotNull(u1) == getNotNull(u2); // new acmp without null check
 388     }
 389 
 390     public boolean testEq21_7(MyAbstract u1, MyAbstract u2) {
 391         return get(u1) == u2; // new acmp
 392     }
 393 
 394     public boolean testEq21_8(MyAbstract u1, MyAbstract u2) {
 395         return u1 == get(u2); // new acmp
 396     }
 397 
 398     public boolean testEq21_9(MyAbstract u1, MyAbstract u2) {
 399         return get(u1) == get(u2); // new acmp
 400     }
 401 
 402     @FalseIfNull
 403     public boolean testEq21_10(MyAbstract u1, MyAbstract u2) {
 404         return getNotNull(u1) == u2; // new acmp without null check
 405     }
 406 
 407     @FalseIfNull
 408     public boolean testEq21_11(MyAbstract u1, MyAbstract u2) {
 409         return u1 == getNotNull(u2); // new acmp without null check
 410     }
 411 
 412     @FalseIfNull
 413     public boolean testEq21_12(MyAbstract u1, MyAbstract u2) {
 414         return getNotNull(u1) == getNotNull(u2); // new acmp without null check
 415     }
 416 
 417     public boolean testEq22_1(MyValue1 v, MyInterface u) {
 418         return get(v) == u; // only true if both null
 419     }
 420 
 421     public boolean testEq22_2(MyValue1 v, MyInterface u) {
 422         return (Object)v == get(u); // only true if both null
 423     }
 424 
 425     public boolean testEq22_3(MyValue1 v, MyInterface u) {
 426         return get(v) == get(u); // only true if both null
 427     }
 428 
 429     public boolean testEq22_4(MyValue1 v, MyAbstract u) {
 430         return get(v) == u; // only true if both null
 431     }
 432 
 433     public boolean testEq22_5(MyValue1 v, MyAbstract u) {
 434         return (Object)v == get(u); // only true if both null
 435     }
 436 
 437     public boolean testEq22_6(MyValue1 v, MyAbstract u) {
 438         return get(v) == get(u); // only true if both null
 439     }
 440 
 441     public boolean testEq23_1(MyInterface u, MyValue1 v) {
 442         return get(u) == (Object)v; // only true if both null
 443     }
 444 
 445     public boolean testEq23_2(MyInterface u, MyValue1 v) {
 446         return u == get(v); // only true if both null
 447     }
 448 
 449     public boolean testEq23_3(MyInterface u, MyValue1 v) {
 450         return get(u) == get(v); // only true if both null
 451     }
 452 
 453     public boolean testEq23_4(MyAbstract u, MyValue1 v) {
 454         return get(u) == (Object)v; // only true if both null
 455     }
 456 
 457     public boolean testEq23_5(MyAbstract u, MyValue1 v) {
 458         return u == get(v); // only true if both null
 459     }
 460 
 461     public boolean testEq23_6(MyAbstract u, MyValue1 v) {
 462         return get(u) == get(v); // only true if both null
 463     }
 464 
 465     public boolean testEq24_1(MyValue1 v, MyInterface u) {
 466         return getNotNull(v) == u; // false
 467     }
 468 
 469     public boolean testEq24_2(MyValue1 v, MyInterface u) {
 470         return (Object)v == getNotNull(u); // false
 471     }
 472 
 473     public boolean testEq24_3(MyValue1 v, MyInterface u) {
 474         return getNotNull(v) == getNotNull(u); // false
 475     }
 476 
 477     public boolean testEq24_4(MyValue1 v, MyAbstract u) {
 478         return getNotNull(v) == u; // false
 479     }
 480 
 481     public boolean testEq24_5(MyValue1 v, MyAbstract u) {
 482         return (Object)v == getNotNull(u); // false
 483     }
 484 
 485     public boolean testEq24_6(MyValue1 v, MyAbstract u) {
 486         return getNotNull(v) == getNotNull(u); // false
 487     }
 488 
 489     public boolean testEq25_1(MyInterface u, MyValue1 v) {
 490         return getNotNull(u) == (Object)v; // false
 491     }
 492 
 493     public boolean testEq25_2(MyInterface u, MyValue1 v) {
 494         return u == getNotNull(v); // false
 495     }
 496 
 497     public boolean testEq25_3(MyInterface u, MyValue1 v) {
 498         return getNotNull(u) == getNotNull(v); // false
 499     }
 500 
 501     public boolean testEq25_4(MyAbstract u, MyValue1 v) {
 502         return getNotNull(u) == (Object)v; // false
 503     }
 504 
 505     public boolean testEq25_5(MyAbstract u, MyValue1 v) {
 506         return u == getNotNull(v); // false
 507     }
 508 
 509     public boolean testEq25_6(MyAbstract u, MyValue1 v) {
 510         return getNotNull(u) == getNotNull(v); // false
 511     }
 512 
 513     public boolean testEq26_1(MyInterface u, MyObject o) {
 514         return get(u) == o; // old acmp
 515     }
 516 
 517     public boolean testEq26_2(MyInterface u, MyObject o) {
 518         return u == get(o); // old acmp
 519     }
 520 
 521     public boolean testEq26_3(MyInterface u, MyObject o) {
 522         return get(u) == get(o); // old acmp
 523     }
 524 
 525     public boolean testEq26_4(MyAbstract u, MyObject o) {
 526         return get(u) == o; // old acmp
 527     }
 528 
 529     public boolean testEq26_5(MyAbstract u, MyObject o) {
 530         return u == get(o); // old acmp
 531     }
 532 
 533     public boolean testEq26_6(MyAbstract u, MyObject o) {
 534         return get(u) == get(o); // old acmp
 535     }
 536 
 537     public boolean testEq27_1(MyObject o, MyInterface u) {
 538         return get(o) == u; // old acmp
 539     }
 540 
 541     public boolean testEq27_2(MyObject o, MyInterface u) {
 542         return o == get(u); // old acmp
 543     }
 544 
 545     public boolean testEq27_3(MyObject o, MyInterface u) {
 546         return get(o) == get(u); // old acmp
 547     }
 548 
 549     public boolean testEq27_4(MyObject o, MyAbstract u) {
 550         return get(o) == u; // old acmp
 551     }
 552 
 553     public boolean testEq27_5(MyObject o, MyAbstract u) {
 554         return o == get(u); // old acmp
 555     }
 556 
 557     public boolean testEq27_6(MyObject o, MyAbstract u) {
 558         return get(o) == get(u); // old acmp
 559     }
 560 
 561     public boolean testEq28_1(MyInterface[] a, MyInterface u) {
 562         return get(a) == u; // old acmp
 563     }
 564 
 565     public boolean testEq28_2(MyInterface[] a, MyInterface u) {
 566         return a == get(u); // old acmp
 567     }
 568 
 569     public boolean testEq28_3(MyInterface[] a, MyInterface u) {
 570         return get(a) == get(u); // old acmp
 571     }
 572 
 573     public boolean testEq28_4(MyAbstract[] a, MyAbstract u) {
 574         return get(a) == u; // old acmp
 575     }
 576 
 577     public boolean testEq28_5(MyAbstract[] a, MyAbstract u) {
 578         return a == get(u); // old acmp
 579     }
 580 
 581     public boolean testEq28_6(MyAbstract[] a, MyAbstract u) {
 582         return get(a) == get(u); // old acmp
 583     }
 584 
 585     public boolean testEq29_1(MyInterface u, MyInterface[] a) {
 586         return get(u) == a; // old acmp
 587     }
 588 
 589     public boolean testEq29_2(MyInterface u, MyInterface[] a) {
 590         return u == get(a); // old acmp
 591     }
 592 
 593     public boolean testEq29_3(MyInterface u, MyInterface[] a) {
 594         return get(u) == get(a); // old acmp
 595     }
 596 
 597     public boolean testEq29_4(MyAbstract u, MyAbstract[] a) {
 598         return get(u) == a; // old acmp
 599     }
 600 
 601     public boolean testEq29_5(MyAbstract u, MyAbstract[] a) {
 602         return u == get(a); // old acmp
 603     }
 604 
 605     public boolean testEq29_6(MyAbstract u, MyAbstract[] a) {
 606         return get(u) == get(a); // old acmp
 607     }
 608 
 609     public boolean testEq30_1(MyInterface[] a, MyValue1 v) {
 610         return get(a) == (Object)v; // only true if both null
 611     }
 612 
 613     public boolean testEq30_2(MyInterface[] a, MyValue1 v) {
 614         return a == get(v); // only true if both null
 615     }
 616 
 617     public boolean testEq30_3(MyInterface[] a, MyValue1 v) {
 618         return get(a) == get(v); // only true if both null
 619     }
 620 
 621     public boolean testEq30_4(MyAbstract[] a, MyValue1 v) {
 622         return get(a) == (Object)v; // only true if both null
 623     }
 624 
 625     public boolean testEq30_5(MyAbstract[] a, MyValue1 v) {
 626         return a == get(v); // only true if both null
 627     }
 628 
 629     public boolean testEq30_6(MyAbstract[] a, MyValue1 v) {
 630         return get(a) == get(v); // only true if both null
 631     }
 632 
 633     public boolean testEq31_1(MyValue1 v, MyInterface[] a) {
 634         return get(v) == a; // only true if both null
 635     }
 636 
 637     public boolean testEq31_2(MyValue1 v, MyInterface[] a) {
 638         return (Object)v == get(a); // only true if both null
 639     }
 640 
 641     public boolean testEq31_3(MyValue1 v, MyInterface[] a) {
 642         return get(v) == get(a); // only true if both null
 643     }
 644 
 645     public boolean testEq31_4(MyValue1 v, MyAbstract[] a) {
 646         return get(v) == a; // only true if both null
 647     }
 648 
 649     public boolean testEq31_5(MyValue1 v, MyAbstract[] a) {
 650         return (Object)v == get(a); // only true if both null
 651     }
 652 
 653     public boolean testEq31_6(MyValue1 v, MyAbstract[] a) {
 654         return get(v) == get(a); // only true if both null
 655     }
 656 
 657     public boolean testEq32_1(MyInterface[] a, MyValue1 v) {
 658         return getNotNull(a) == (Object)v; // false
 659     }
 660 
 661     public boolean testEq32_2(MyInterface[] a, MyValue1 v) {
 662         return a == getNotNull(v); // false
 663     }
 664 
 665     public boolean testEq32_3(MyInterface[] a, MyValue1 v) {
 666         return getNotNull(a) == getNotNull(v); // false
 667     }
 668 
 669     public boolean testEq32_4(MyAbstract[] a, MyValue1 v) {
 670         return getNotNull(a) == (Object)v; // false
 671     }
 672 
 673     public boolean testEq32_5(MyAbstract[] a, MyValue1 v) {
 674         return a == getNotNull(v); // false
 675     }
 676 
 677     public boolean testEq32_6(MyAbstract[] a, MyValue1 v) {
 678         return getNotNull(a) == getNotNull(v); // false
 679     }
 680 
 681     public boolean testEq33_1(MyValue1 v, MyInterface[] a) {
 682         return getNotNull(v) == a; // false
 683     }
 684 
 685     public boolean testEq33_2(MyValue1 v, MyInterface[] a) {
 686         return (Object)v == getNotNull(a); // false
 687     }
 688 
 689     public boolean testEq33_3(MyValue1 v, MyInterface[] a) {
 690         return getNotNull(v) == getNotNull(a); // false
 691     }
 692 
 693     public boolean testEq33_4(MyValue1 v, MyAbstract[] a) {
 694         return getNotNull(v) == a; // false
 695     }
 696 
 697     public boolean testEq33_5(MyValue1 v, MyAbstract[] a) {
 698         return (Object)v == getNotNull(a); // false
 699     }
 700 
 701     public boolean testEq33_6(MyValue1 v, MyAbstract[] a) {
 702         return getNotNull(v) == getNotNull(a); // false
 703     }
 704 
 705 
 706     // Null tests
 707 
 708     public boolean testNull01_1(MyValue1 v) {
 709         return (Object)v == null; // old acmp
 710     }
 711 
 712     public boolean testNull01_2(MyValue1 v) {
 713         return get(v) == null; // old acmp
 714     }
 715 
 716     public boolean testNull01_3(MyValue1 v) {
 717         return (Object)v == get((Object)null); // old acmp
 718     }
 719 
 720     public boolean testNull01_4(MyValue1 v) {
 721         return get(v) == get((Object)null); // old acmp
 722     }
 723 
 724     public boolean testNull02_1(MyValue1 v) {
 725         return null == (Object)v; // old acmp
 726     }
 727 
 728     public boolean testNull02_2(MyValue1 v) {
 729         return get((Object)null) == (Object)v; // old acmp
 730     }
 731 
 732     public boolean testNull02_3(MyValue1 v) {
 733         return null == get(v); // old acmp
 734     }
 735 
 736     public boolean testNull02_4(MyValue1 v) {
 737         return get((Object)null) == get(v); // old acmp
 738     }
 739 
 740     public boolean testNull03_1(Object u) {
 741         return u == null; // old acmp
 742     }
 743 
 744     public boolean testNull03_2(Object u) {
 745         return get(u) == null; // old acmp
 746     }
 747 
 748     public boolean testNull03_3(Object u) {
 749         return u == get((Object)null); // old acmp
 750     }
 751 
 752     public boolean testNull03_4(Object u) {
 753         return get(u) == get((Object)null); // old acmp
 754     }
 755 
 756     public boolean testNull04_1(Object u) {
 757         return null == u; // old acmp
 758     }
 759 
 760     public boolean testNull04_2(Object u) {
 761         return get((Object)null) == u; // old acmp
 762     }
 763 
 764     public boolean testNull04_3(Object u) {
 765         return null == get(u); // old acmp
 766     }
 767 
 768     public boolean testNull04_4(Object u) {
 769         return get((Object)null) == get(u); // old acmp
 770     }
 771 
 772     public boolean testNull05_1(MyObject o) {
 773         return o == null; // old acmp
 774     }
 775 
 776     public boolean testNull05_2(MyObject o) {
 777         return get(o) == null; // old acmp
 778     }
 779 
 780     public boolean testNull05_3(MyObject o) {
 781         return o == get((Object)null); // old acmp
 782     }
 783 
 784     public boolean testNull05_4(MyObject o) {
 785         return get(o) == get((Object)null); // old acmp
 786     }
 787 
 788     public boolean testNull06_1(MyObject o) {
 789         return null == o; // old acmp
 790     }
 791 
 792     public boolean testNull06_2(MyObject o) {
 793         return get((Object)null) == o; // old acmp
 794     }
 795 
 796     public boolean testNull06_3(MyObject o) {
 797         return null == get(o); // old acmp
 798     }
 799 
 800     public boolean testNull06_4(MyObject o) {
 801         return get((Object)null) == get(o); // old acmp
 802     }
 803 
 804     public boolean testNull07_1(MyInterface u) {
 805         return u == null; // old acmp
 806     }
 807 
 808     public boolean testNull07_2(MyInterface u) {
 809         return get(u) == null; // old acmp
 810     }
 811 
 812     public boolean testNull07_3(MyInterface u) {
 813         return u == get((Object)null); // old acmp
 814     }
 815 
 816     public boolean testNull07_4(MyInterface u) {
 817         return get(u) == get((Object)null); // old acmp
 818     }
 819 
 820     public boolean testNull07_5(MyAbstract u) {
 821         return u == null; // old acmp
 822     }
 823 
 824     public boolean testNull07_6(MyAbstract u) {
 825         return get(u) == null; // old acmp
 826     }
 827 
 828     public boolean testNull07_7(MyAbstract u) {
 829         return u == get((Object)null); // old acmp
 830     }
 831 
 832     public boolean testNull07_8(MyAbstract u) {
 833         return get(u) == get((Object)null); // old acmp
 834     }
 835 
 836     public boolean testNull08_1(MyInterface u) {
 837         return null == u; // old acmp
 838     }
 839 
 840     public boolean testNull08_2(MyInterface u) {
 841         return get((Object)null) == u; // old acmp
 842     }
 843 
 844     public boolean testNull08_3(MyInterface u) {
 845         return null == get(u); // old acmp
 846     }
 847 
 848     public boolean testNull08_4(MyInterface u) {
 849         return get((Object)null) == get(u); // old acmp
 850     }
 851 
 852     public boolean testNull08_5(MyAbstract u) {
 853         return null == u; // old acmp
 854     }
 855 
 856     public boolean testNull08_6(MyAbstract u) {
 857         return get((Object)null) == u; // old acmp
 858     }
 859 
 860     public boolean testNull08_7(MyAbstract u) {
 861         return null == get(u); // old acmp
 862     }
 863 
 864     public boolean testNull08_8(MyAbstract u) {
 865         return get((Object)null) == get(u); // old acmp
 866     }
 867 
 868     // Same tests as above but negated
 869 
 870     public boolean testNotEq01_1(Object u1, Object u2) {
 871         return get(u1) != u2; // new acmp
 872     }
 873 
 874     public boolean testNotEq01_2(Object u1, Object u2) {
 875         return u1 != get(u2); // new acmp
 876     }
 877 
 878     public boolean testNotEq01_3(Object u1, Object u2) {
 879         return get(u1) != get(u2); // new acmp
 880     }
 881 
 882     @TrueIfNull
 883     public boolean testNotEq01_4(Object u1, Object u2) {
 884         return getNotNull(u1) != u2; // new acmp without null check
 885     }
 886 
 887     @TrueIfNull
 888     public boolean testNotEq01_5(Object u1, Object u2) {
 889         return u1 != getNotNull(u2); // new acmp without null check
 890     }
 891 
 892     @TrueIfNull
 893     public boolean testNotEq01_6(Object u1, Object u2) {
 894         return getNotNull(u1) != getNotNull(u2); // new acmp without null check
 895     }
 896 
 897     public boolean testNotEq02_1(MyValue1 v1, MyValue1 v2) {
 898         return get(v1) != (Object)v2; // only false if both null
 899     }
 900 
 901     public boolean testNotEq02_2(MyValue1 v1, MyValue1 v2) {
 902         return (Object)v1 != get(v2); // only false if both null
 903     }
 904 
 905     public boolean testNotEq02_3(MyValue1 v1, MyValue1 v2) {
 906         return get(v1) != get(v2); // only false if both null
 907     }
 908 
 909     public boolean testNotEq03_1(MyValue1 v, Object u) {
 910         return get(v) != u; // only false if both null
 911     }
 912 
 913     public boolean testNotEq03_2(MyValue1 v, Object u) {
 914         return (Object)v != get(u); // only false if both null
 915     }
 916 
 917     public boolean testNotEq03_3(MyValue1 v, Object u) {
 918         return get(v) != get(u); // only false if both null
 919     }
 920 
 921     public boolean testNotEq04_1(Object u, MyValue1 v) {
 922         return get(u) != (Object)v; // only false if both null
 923     }
 924 
 925     public boolean testNotEq04_2(Object u, MyValue1 v) {
 926         return u != get(v); // only false if both null
 927     }
 928 
 929     public boolean testNotEq04_3(Object u, MyValue1 v) {
 930         return get(u) != get(v); // only false if both null
 931     }
 932 
 933     public boolean testNotEq05_1(MyObject o, MyValue1 v) {
 934         return get(o) != (Object)v; // only false if both null
 935     }
 936 
 937     public boolean testNotEq05_2(MyObject o, MyValue1 v) {
 938         return o != get(v); // only false if both null
 939     }
 940 
 941     public boolean testNotEq05_3(MyObject o, MyValue1 v) {
 942         return get(o) != get(v); // only false if both null
 943     }
 944 
 945     public boolean testNotEq06_1(MyValue1 v, MyObject o) {
 946         return get(v) != o; // only false if both null
 947     }
 948 
 949     public boolean testNotEq06_2(MyValue1 v, MyObject o) {
 950         return (Object)v != get(o); // only false if both null
 951     }
 952 
 953     public boolean testNotEq06_3(MyValue1 v, MyObject o) {
 954         return get(v) != get(o); // only false if both null
 955     }
 956 
 957     public boolean testNotEq07_1(MyValue1 v1, MyValue1 v2) {
 958         return getNotNull(v1) != (Object)v2; // true
 959     }
 960 
 961     public boolean testNotEq07_2(MyValue1 v1, MyValue1 v2) {
 962         return (Object)v1 != getNotNull(v2); // true
 963     }
 964 
 965     public boolean testNotEq07_3(MyValue1 v1, MyValue1 v2) {
 966         return getNotNull(v1) != getNotNull(v2); // true
 967     }
 968 
 969     public boolean testNotEq08_1(MyValue1 v, Object u) {
 970         return getNotNull(v) != u; // true
 971     }
 972 
 973     public boolean testNotEq08_2(MyValue1 v, Object u) {
 974         return (Object)v != getNotNull(u); // true
 975     }
 976 
 977     public boolean testNotEq08_3(MyValue1 v, Object u) {
 978         return getNotNull(v) != getNotNull(u); // true
 979     }
 980 
 981     public boolean testNotEq09_1(Object u, MyValue1 v) {
 982         return getNotNull(u) != (Object)v; // true
 983     }
 984 
 985     public boolean testNotEq09_2(Object u, MyValue1 v) {
 986         return u != getNotNull(v); // true
 987     }
 988 
 989     public boolean testNotEq09_3(Object u, MyValue1 v) {
 990         return getNotNull(u) != getNotNull(v); // true
 991     }
 992 
 993     public boolean testNotEq10_1(MyObject o, MyValue1 v) {
 994         return getNotNull(o) != (Object)v; // true
 995     }
 996 
 997     public boolean testNotEq10_2(MyObject o, MyValue1 v) {
 998         return o != getNotNull(v); // true
 999     }
1000 
1001     public boolean testNotEq10_3(MyObject o, MyValue1 v) {
1002         return getNotNull(o) != getNotNull(v); // true
1003     }
1004 
1005     public boolean testNotEq11_1(MyValue1 v, MyObject o) {
1006         return getNotNull(v) != o; // true
1007     }
1008 
1009     public boolean testNotEq11_2(MyValue1 v, MyObject o) {
1010         return (Object)v != getNotNull(o); // true
1011     }
1012 
1013     public boolean testNotEq11_3(MyValue1 v, MyObject o) {
1014         return getNotNull(v) != getNotNull(o); // true
1015     }
1016 
1017     public boolean testNotEq12_1(MyObject o1, MyObject o2) {
1018         return get(o1) != o2; // old acmp
1019     }
1020 
1021     public boolean testNotEq12_2(MyObject o1, MyObject o2) {
1022         return o1 != get(o2); // old acmp
1023     }
1024 
1025     public boolean testNotEq12_3(MyObject o1, MyObject o2) {
1026         return get(o1) != get(o2); // old acmp
1027     }
1028 
1029     public boolean testNotEq13_1(Object u, MyObject o) {
1030         return get(u) != o; // old acmp
1031     }
1032 
1033     public boolean testNotEq13_2(Object u, MyObject o) {
1034         return u != get(o); // old acmp
1035     }
1036 
1037     public boolean testNotEq13_3(Object u, MyObject o) {
1038         return get(u) != get(o); // old acmp
1039     }
1040 
1041     public boolean testNotEq14_1(MyObject o, Object u) {
1042         return get(o) != u; // old acmp
1043     }
1044 
1045     public boolean testNotEq14_2(MyObject o, Object u) {
1046         return o != get(u); // old acmp
1047     }
1048 
1049     public boolean testNotEq14_3(MyObject o, Object u) {
1050         return get(o) != get(u); // old acmp
1051     }
1052 
1053     public boolean testNotEq15_1(Object[] a, Object u) {
1054         return get(a) != u; // old acmp
1055     }
1056 
1057     public boolean testNotEq15_2(Object[] a, Object u) {
1058         return a != get(u); // old acmp
1059     }
1060 
1061     public boolean testNotEq15_3(Object[] a, Object u) {
1062         return get(a) != get(u); // old acmp
1063     }
1064 
1065     public boolean testNotEq16_1(Object u, Object[] a) {
1066         return get(u) != a; // old acmp
1067     }
1068 
1069     public boolean testNotEq16_2(Object u, Object[] a) {
1070         return u != get(a); // old acmp
1071     }
1072 
1073     public boolean testNotEq16_3(Object u, Object[] a) {
1074         return get(u) != get(a); // old acmp
1075     }
1076 
1077     public boolean testNotEq17_1(Object[] a, MyValue1 v) {
1078         return get(a) != (Object)v; // only false if both null
1079     }
1080 
1081     public boolean testNotEq17_2(Object[] a, MyValue1 v) {
1082         return a != get(v); // only false if both null
1083     }
1084 
1085     public boolean testNotEq17_3(Object[] a, MyValue1 v) {
1086         return get(a) != get(v); // only false if both null
1087     }
1088 
1089     public boolean testNotEq18_1(MyValue1 v, Object[] a) {
1090         return get(v) != a; // only false if both null
1091     }
1092 
1093     public boolean testNotEq18_2(MyValue1 v, Object[] a) {
1094         return (Object)v != get(a); // only false if both null
1095     }
1096 
1097     public boolean testNotEq18_3(MyValue1 v, Object[] a) {
1098         return get(v) != get(a); // only false if both null
1099     }
1100 
1101     public boolean testNotEq19_1(Object[] a, MyValue1 v) {
1102         return getNotNull(a) != (Object)v; // true
1103     }
1104 
1105     public boolean testNotEq19_2(Object[] a, MyValue1 v) {
1106         return a != getNotNull(v); // true
1107     }
1108 
1109     public boolean testNotEq19_3(Object[] a, MyValue1 v) {
1110         return getNotNull(a) != getNotNull(v); // true
1111     }
1112 
1113     public boolean testNotEq20_1(MyValue1 v, Object[] a) {
1114         return getNotNull(v) != a; // true
1115     }
1116 
1117     public boolean testNotEq20_2(MyValue1 v, Object[] a) {
1118         return (Object)v != getNotNull(a); // true
1119     }
1120 
1121     public boolean testNotEq20_3(MyValue1 v, Object[] a) {
1122         return getNotNull(v) != getNotNull(a); // true
1123     }
1124 
1125     public boolean testNotEq21_1(MyInterface u1, MyInterface u2) {
1126         return get(u1) != u2; // new acmp
1127     }
1128 
1129     public boolean testNotEq21_2(MyInterface u1, MyInterface u2) {
1130         return u1 != get(u2); // new acmp
1131     }
1132 
1133     public boolean testNotEq21_3(MyInterface u1, MyInterface u2) {
1134         return get(u1) != get(u2); // new acmp
1135     }
1136 
1137     @TrueIfNull
1138     public boolean testNotEq21_4(MyInterface u1, MyInterface u2) {
1139         return getNotNull(u1) != u2; // new acmp without null check
1140     }
1141 
1142     @TrueIfNull
1143     public boolean testNotEq21_5(MyInterface u1, MyInterface u2) {
1144         return u1 != getNotNull(u2); // new acmp without null check
1145     }
1146 
1147     @TrueIfNull
1148     public boolean testNotEq21_6(MyInterface u1, MyInterface u2) {
1149         return getNotNull(u1) != getNotNull(u2); // new acmp without null check
1150     }
1151 
1152     public boolean testNotEq21_7(MyAbstract u1, MyAbstract u2) {
1153         return get(u1) != u2; // new acmp
1154     }
1155 
1156     public boolean testNotEq21_8(MyAbstract u1, MyAbstract u2) {
1157         return u1 != get(u2); // new acmp
1158     }
1159 
1160     public boolean testNotEq21_9(MyAbstract u1, MyAbstract u2) {
1161         return get(u1) != get(u2); // new acmp
1162     }
1163 
1164     @TrueIfNull
1165     public boolean testNotEq21_10(MyAbstract u1, MyAbstract u2) {
1166         return getNotNull(u1) != u2; // new acmp without null check
1167     }
1168 
1169     @TrueIfNull
1170     public boolean testNotEq21_11(MyAbstract u1, MyAbstract u2) {
1171         return u1 != getNotNull(u2); // new acmp without null check
1172     }
1173 
1174     @TrueIfNull
1175     public boolean testNotEq21_12(MyAbstract u1, MyAbstract u2) {
1176         return getNotNull(u1) != getNotNull(u2); // new acmp without null check
1177     }
1178 
1179     public boolean testNotEq22_1(MyValue1 v, MyInterface u) {
1180         return get(v) != u; // only false if both null
1181     }
1182 
1183     public boolean testNotEq22_2(MyValue1 v, MyInterface u) {
1184         return (Object)v != get(u); // only false if both null
1185     }
1186 
1187     public boolean testNotEq22_3(MyValue1 v, MyInterface u) {
1188         return get(v) != get(u); // only false if both null
1189     }
1190 
1191     public boolean testNotEq22_4(MyValue1 v, MyAbstract u) {
1192         return get(v) != u; // only false if both null
1193     }
1194 
1195     public boolean testNotEq22_5(MyValue1 v, MyAbstract u) {
1196         return (Object)v != get(u); // only false if both null
1197     }
1198 
1199     public boolean testNotEq22_6(MyValue1 v, MyAbstract u) {
1200         return get(v) != get(u); // only false if both null
1201     }
1202 
1203     public boolean testNotEq23_1(MyInterface u, MyValue1 v) {
1204         return get(u) != (Object)v; // only false if both null
1205     }
1206 
1207     public boolean testNotEq23_2(MyInterface u, MyValue1 v) {
1208         return u != get(v); // only false if both null
1209     }
1210 
1211     public boolean testNotEq23_3(MyInterface u, MyValue1 v) {
1212         return get(u) != get(v); // only false if both null
1213     }
1214 
1215     public boolean testNotEq23_4(MyAbstract u, MyValue1 v) {
1216         return get(u) != (Object)v; // only false if both null
1217     }
1218 
1219     public boolean testNotEq23_5(MyAbstract u, MyValue1 v) {
1220         return u != get(v); // only false if both null
1221     }
1222 
1223     public boolean testNotEq23_6(MyAbstract u, MyValue1 v) {
1224         return get(u) != get(v); // only false if both null
1225     }
1226 
1227     public boolean testNotEq24_1(MyValue1 v, MyInterface u) {
1228         return getNotNull(v) != u; // true
1229     }
1230 
1231     public boolean testNotEq24_2(MyValue1 v, MyInterface u) {
1232         return (Object)v != getNotNull(u); // true
1233     }
1234 
1235     public boolean testNotEq24_3(MyValue1 v, MyInterface u) {
1236         return getNotNull(v) != getNotNull(u); // true
1237     }
1238 
1239     public boolean testNotEq24_4(MyValue1 v, MyAbstract u) {
1240         return getNotNull(v) != u; // true
1241     }
1242 
1243     public boolean testNotEq24_5(MyValue1 v, MyAbstract u) {
1244         return (Object)v != getNotNull(u); // true
1245     }
1246 
1247     public boolean testNotEq24_6(MyValue1 v, MyAbstract u) {
1248         return getNotNull(v) != getNotNull(u); // true
1249     }
1250 
1251     public boolean testNotEq25_1(MyInterface u, MyValue1 v) {
1252         return getNotNull(u) != (Object)v; // true
1253     }
1254 
1255     public boolean testNotEq25_2(MyInterface u, MyValue1 v) {
1256         return u != getNotNull(v); // true
1257     }
1258 
1259     public boolean testNotEq25_3(MyInterface u, MyValue1 v) {
1260         return getNotNull(u) != getNotNull(v); // true
1261     }
1262 
1263     public boolean testNotEq25_4(MyAbstract u, MyValue1 v) {
1264         return getNotNull(u) != (Object)v; // true
1265     }
1266 
1267     public boolean testNotEq25_5(MyAbstract u, MyValue1 v) {
1268         return u != getNotNull(v); // true
1269     }
1270 
1271     public boolean testNotEq25_6(MyAbstract u, MyValue1 v) {
1272         return getNotNull(u) != getNotNull(v); // true
1273     }
1274 
1275     public boolean testNotEq26_1(MyInterface u, MyObject o) {
1276         return get(u) != o; // old acmp
1277     }
1278 
1279     public boolean testNotEq26_2(MyInterface u, MyObject o) {
1280         return u != get(o); // old acmp
1281     }
1282 
1283     public boolean testNotEq26_3(MyInterface u, MyObject o) {
1284         return get(u) != get(o); // old acmp
1285     }
1286 
1287     public boolean testNotEq26_4(MyAbstract u, MyObject o) {
1288         return get(u) != o; // old acmp
1289     }
1290 
1291     public boolean testNotEq26_5(MyAbstract u, MyObject o) {
1292         return u != get(o); // old acmp
1293     }
1294 
1295     public boolean testNotEq26_6(MyAbstract u, MyObject o) {
1296         return get(u) != get(o); // old acmp
1297     }
1298 
1299     public boolean testNotEq27_1(MyObject o, MyInterface u) {
1300         return get(o) != u; // old acmp
1301     }
1302 
1303     public boolean testNotEq27_2(MyObject o, MyInterface u) {
1304         return o != get(u); // old acmp
1305     }
1306 
1307     public boolean testNotEq27_3(MyObject o, MyInterface u) {
1308         return get(o) != get(u); // old acmp
1309     }
1310 
1311     public boolean testNotEq27_4(MyObject o, MyAbstract u) {
1312         return get(o) != u; // old acmp
1313     }
1314 
1315     public boolean testNotEq27_5(MyObject o, MyAbstract u) {
1316         return o != get(u); // old acmp
1317     }
1318 
1319     public boolean testNotEq27_6(MyObject o, MyAbstract u) {
1320         return get(o) != get(u); // old acmp
1321     }
1322 
1323     public boolean testNotEq28_1(MyInterface[] a, MyInterface u) {
1324         return get(a) != u; // old acmp
1325     }
1326 
1327     public boolean testNotEq28_2(MyInterface[] a, MyInterface u) {
1328         return a != get(u); // old acmp
1329     }
1330 
1331     public boolean testNotEq28_3(MyInterface[] a, MyInterface u) {
1332         return get(a) != get(u); // old acmp
1333     }
1334 
1335     public boolean testNotEq28_4(MyAbstract[] a, MyAbstract u) {
1336         return get(a) != u; // old acmp
1337     }
1338 
1339     public boolean testNotEq28_5(MyAbstract[] a, MyAbstract u) {
1340         return a != get(u); // old acmp
1341     }
1342 
1343     public boolean testNotEq28_6(MyAbstract[] a, MyAbstract u) {
1344         return get(a) != get(u); // old acmp
1345     }
1346 
1347     public boolean testNotEq29_1(MyInterface u, MyInterface[] a) {
1348         return get(u) != a; // old acmp
1349     }
1350 
1351     public boolean testNotEq29_2(MyInterface u, MyInterface[] a) {
1352         return u != get(a); // old acmp
1353     }
1354 
1355     public boolean testNotEq29_3(MyInterface u, MyInterface[] a) {
1356         return get(u) != get(a); // old acmp
1357     }
1358 
1359     public boolean testNotEq29_4(MyAbstract u, MyAbstract[] a) {
1360         return get(u) != a; // old acmp
1361     }
1362 
1363     public boolean testNotEq29_5(MyAbstract u, MyAbstract[] a) {
1364         return u != get(a); // old acmp
1365     }
1366 
1367     public boolean testNotEq29_6(MyAbstract u, MyAbstract[] a) {
1368         return get(u) != get(a); // old acmp
1369     }
1370 
1371     public boolean testNotEq30_1(MyInterface[] a, MyValue1 v) {
1372         return get(a) != (Object)v; // only false if both null
1373     }
1374 
1375     public boolean testNotEq30_2(MyInterface[] a, MyValue1 v) {
1376         return a != get(v); // only false if both null
1377     }
1378 
1379     public boolean testNotEq30_3(MyInterface[] a, MyValue1 v) {
1380         return get(a) != get(v); // only false if both null
1381     }
1382 
1383     public boolean testNotEq30_4(MyAbstract[] a, MyValue1 v) {
1384         return get(a) != (Object)v; // only false if both null
1385     }
1386 
1387     public boolean testNotEq30_5(MyAbstract[] a, MyValue1 v) {
1388         return a != get(v); // only false if both null
1389     }
1390 
1391     public boolean testNotEq30_6(MyAbstract[] a, MyValue1 v) {
1392         return get(a) != get(v); // only false if both null
1393     }
1394 
1395     public boolean testNotEq31_1(MyValue1 v, MyInterface[] a) {
1396         return get(v) != a; // only false if both null
1397     }
1398 
1399     public boolean testNotEq31_2(MyValue1 v, MyInterface[] a) {
1400         return (Object)v != get(a); // only false if both null
1401     }
1402 
1403     public boolean testNotEq31_3(MyValue1 v, MyInterface[] a) {
1404         return get(v) != get(a); // only false if both null
1405     }
1406 
1407     public boolean testNotEq31_4(MyValue1 v, MyAbstract[] a) {
1408         return get(v) != a; // only false if both null
1409     }
1410 
1411     public boolean testNotEq31_5(MyValue1 v, MyAbstract[] a) {
1412         return (Object)v != get(a); // only false if both null
1413     }
1414 
1415     public boolean testNotEq31_6(MyValue1 v, MyAbstract[] a) {
1416         return get(v) != get(a); // only false if both null
1417     }
1418 
1419     public boolean testNotEq32_1(MyInterface[] a, MyValue1 v) {
1420         return getNotNull(a) != (Object)v; // true
1421     }
1422 
1423     public boolean testNotEq32_2(MyInterface[] a, MyValue1 v) {
1424         return a != getNotNull(v); // true
1425     }
1426 
1427     public boolean testNotEq32_3(MyInterface[] a, MyValue1 v) {
1428         return getNotNull(a) != getNotNull(v); // true
1429     }
1430 
1431     public boolean testNotEq32_4(MyAbstract[] a, MyValue1 v) {
1432         return getNotNull(a) != (Object)v; // true
1433     }
1434 
1435     public boolean testNotEq32_5(MyAbstract[] a, MyValue1 v) {
1436         return a != getNotNull(v); // true
1437     }
1438 
1439     public boolean testNotEq32_6(MyAbstract[] a, MyValue1 v) {
1440         return getNotNull(a) != getNotNull(v); // true
1441     }
1442 
1443     public boolean testNotEq33_1(MyValue1 v, MyInterface[] a) {
1444         return getNotNull(v) != a; // true
1445     }
1446 
1447     public boolean testNotEq33_2(MyValue1 v, MyInterface[] a) {
1448         return (Object)v != getNotNull(a); // true
1449     }
1450 
1451     public boolean testNotEq33_3(MyValue1 v, MyInterface[] a) {
1452         return getNotNull(v) != getNotNull(a); // true
1453     }
1454 
1455     public boolean testNotEq33_4(MyValue1 v, MyAbstract[] a) {
1456         return getNotNull(v) != a; // true
1457     }
1458 
1459     public boolean testNotEq33_5(MyValue1 v, MyAbstract[] a) {
1460         return (Object)v != getNotNull(a); // true
1461     }
1462 
1463     public boolean testNotEq33_6(MyValue1 v, MyAbstract[] a) {
1464         return getNotNull(v) != getNotNull(a); // true
1465     }
1466 
1467     // Null tests
1468 
1469     public boolean testNotNull01_1(MyValue1 v) {
1470         return (Object)v != null; // old acmp
1471     }
1472 
1473     public boolean testNotNull01_2(MyValue1 v) {
1474         return get(v) != null; // old acmp
1475     }
1476 
1477     public boolean testNotNull01_3(MyValue1 v) {
1478         return (Object)v != get((Object)null); // old acmp
1479     }
1480 
1481     public boolean testNotNull01_4(MyValue1 v) {
1482         return get(v) != get((Object)null); // old acmp
1483     }
1484 
1485     public boolean testNotNull02_1(MyValue1 v) {
1486         return null != (Object)v; // old acmp
1487     }
1488 
1489     public boolean testNotNull02_2(MyValue1 v) {
1490         return get((Object)null) != (Object)v; // old acmp
1491     }
1492 
1493     public boolean testNotNull02_3(MyValue1 v) {
1494         return null != get(v); // old acmp
1495     }
1496 
1497     public boolean testNotNull02_4(MyValue1 v) {
1498         return get((Object)null) != get(v); // old acmp
1499     }
1500 
1501     public boolean testNotNull03_1(Object u) {
1502         return u != null; // old acmp
1503     }
1504 
1505     public boolean testNotNull03_2(Object u) {
1506         return get(u) != null; // old acmp
1507     }
1508 
1509     public boolean testNotNull03_3(Object u) {
1510         return u != get((Object)null); // old acmp
1511     }
1512 
1513     public boolean testNotNull03_4(Object u) {
1514         return get(u) != get((Object)null); // old acmp
1515     }
1516 
1517     public boolean testNotNull04_1(Object u) {
1518         return null != u; // old acmp
1519     }
1520 
1521     public boolean testNotNull04_2(Object u) {
1522         return get((Object)null) != u; // old acmp
1523     }
1524 
1525     public boolean testNotNull04_3(Object u) {
1526         return null != get(u); // old acmp
1527     }
1528 
1529     public boolean testNotNull04_4(Object u) {
1530         return get((Object)null) != get(u); // old acmp
1531     }
1532 
1533     public boolean testNotNull05_1(MyObject o) {
1534         return o != null; // old acmp
1535     }
1536 
1537     public boolean testNotNull05_2(MyObject o) {
1538         return get(o) != null; // old acmp
1539     }
1540 
1541     public boolean testNotNull05_3(MyObject o) {
1542         return o != get((Object)null); // old acmp
1543     }
1544 
1545     public boolean testNotNull05_4(MyObject o) {
1546         return get(o) != get((Object)null); // old acmp
1547     }
1548 
1549     public boolean testNotNull06_1(MyObject o) {
1550         return null != o; // old acmp
1551     }
1552 
1553     public boolean testNotNull06_2(MyObject o) {
1554         return get((Object)null) != o; // old acmp
1555     }
1556 
1557     public boolean testNotNull06_3(MyObject o) {
1558         return null != get(o); // old acmp
1559     }
1560 
1561     public boolean testNotNull06_4(MyObject o) {
1562         return get((Object)null) != get(o); // old acmp
1563     }
1564 
1565     public boolean testNotNull07_1(MyInterface u) {
1566         return u != null; // old acmp
1567     }
1568 
1569     public boolean testNotNull07_2(MyInterface u) {
1570         return get(u) != null; // old acmp
1571     }
1572 
1573     public boolean testNotNull07_3(MyInterface u) {
1574         return u != get((Object)null); // old acmp
1575     }
1576 
1577     public boolean testNotNull07_4(MyInterface u) {
1578         return get(u) != get((Object)null); // old acmp
1579     }
1580 
1581     public boolean testNotNull07_5(MyAbstract u) {
1582         return u != null; // old acmp
1583     }
1584 
1585     public boolean testNotNull07_6(MyAbstract u) {
1586         return get(u) != null; // old acmp
1587     }
1588 
1589     public boolean testNotNull07_7(MyAbstract u) {
1590         return u != get((Object)null); // old acmp
1591     }
1592 
1593     public boolean testNotNull07_8(MyAbstract u) {
1594         return get(u) != get((Object)null); // old acmp
1595     }
1596 
1597     public boolean testNotNull08_1(MyInterface u) {
1598         return null != u; // old acmp
1599     }
1600 
1601     public boolean testNotNull08_2(MyInterface u) {
1602         return get((Object)null) != u; // old acmp
1603     }
1604 
1605     public boolean testNotNull08_3(MyInterface u) {
1606         return null != get(u); // old acmp
1607     }
1608 
1609     public boolean testNotNull08_4(MyInterface u) {
1610         return get((Object)null) != get(u); // old acmp
1611     }
1612 
1613     public boolean testNotNull08_5(MyAbstract u) {
1614         return null != u; // old acmp
1615     }
1616 
1617     public boolean testNotNull08_6(MyAbstract u) {
1618         return get((Object)null) != u; // old acmp
1619     }
1620 
1621     public boolean testNotNull08_7(MyAbstract u) {
1622         return null != get(u); // old acmp
1623     }
1624 
1625     public boolean testNotNull08_8(MyAbstract u) {
1626         return get((Object)null) != get(u); // old acmp
1627     }
1628 
1629     // The following methods are used with -XX:+AlwaysIncrementalInline to hide exact types during parsing
1630 
1631     public Object get(Object u) {
1632         return u;
1633     }
1634 
1635     public Object getNotNull(Object u) {
1636         return (u != null) ? u : new Object();
1637     }
1638 
1639     public Object get(MyValue1 v) {
1640         return v;
1641     }
1642 
1643     public Object getNotNull(MyValue1 v) {
1644         return ((Object)v != null) ? v : MyValue1.createDefault();
1645     }
1646 
1647     public Object get(MyObject o) {
1648         return o;
1649     }
1650 
1651     public Object getNotNull(MyObject o) {
1652         return (o != null) ? o : MyValue1.createDefault();
1653     }
1654 
1655     public Object get(Object[] a) {
1656         return a;
1657     }
1658 
1659     public Object getNotNull(Object[] a) {
1660         return (a != null) ? a : new Object[1];
1661     }
1662 
1663     public boolean trueIfNull(Method m) {
1664         return m.isAnnotationPresent(TrueIfNull.class);
1665     }
1666 
1667     public boolean falseIfNull(Method m) {
1668         return m.isAnnotationPresent(FalseIfNull.class);
1669     }
1670 
1671     public boolean isNegated(Method m) {
1672         return m.getName().startsWith("testNot");
1673     }
1674 
1675     // Tests with profiling
1676     public boolean cmpAlwaysEqual1(Object a, Object b) {
1677         return a == b;
1678     }
1679 
1680     public boolean cmpAlwaysEqual2(Object a, Object b) {
1681         return a != b;
1682     }
1683 
1684     public boolean cmpAlwaysEqual3(Object a) {
1685         return a == a;
1686     }
1687 
1688     public boolean cmpAlwaysEqual4(Object a) {
1689         return a != a;
1690     }
1691 
1692     public boolean cmpAlwaysUnEqual1(Object a, Object b) {
1693         return a == b;
1694     }
1695 
1696     public boolean cmpAlwaysUnEqual2(Object a, Object b) {
1697         return a != b;
1698     }
1699 
1700     public boolean cmpAlwaysUnEqual3(Object a) {
1701         return a == a;
1702     }
1703 
1704     public boolean cmpAlwaysUnEqual4(Object a) {
1705         return a != a;
1706     }
1707 
1708     public boolean cmpSometimesEqual1(Object a) {
1709         return a == a;
1710     }
1711 
1712     public boolean cmpSometimesEqual2(Object a) {
1713         return a != a;
1714     }
1715 
1716     static int get_full_opt_level() {
1717         int n = (int)TieredStopAtLevel;
1718         if (n >= 4) {
1719             n = 4;
1720         }
1721         return n;
1722     }
1723     protected static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox();
1724     protected static final long TieredStopAtLevel = (Long)WHITE_BOX.getVMFlag("TieredStopAtLevel");
1725     protected static final int COMP_LEVEL_FULL_OPTIMIZATION = get_full_opt_level();
1726 
1727     public void runTest(Method m, Object[] args, int warmup, int nullMode, boolean[][] equalities) throws Exception {
1728         Class<?>[] parameterTypes = m.getParameterTypes();
1729         int parameterCount = parameterTypes.length;
1730         // Nullness mode for first argument
1731         // 0: default, 1: never null, 2: always null
1732         int start = (nullMode != 1) ? 0 : 1;
1733         int end = (nullMode != 2) ? args.length : 1;
1734         for (int i = start; i < end; ++i) {
1735             if (args[i] != null && !parameterTypes[0].isInstance(args[i])) {
1736                 continue;
1737             }
1738             if (args[i] == null && parameterTypes[0] == MyValue1.class.asValueType()) {
1739                 continue;
1740             }
1741             if (parameterCount == 1) {
1742                 // Null checks
1743                 System.out.print("Testing " + m.getName() + "(" + args[i] + ")");
1744                 // Avoid acmp in the computation of the expected result!
1745                 boolean expected = isNegated(m) ? (i != 0) : (i == 0);
1746                 for (int run = 0; run < warmup; ++run) {
1747                     Boolean result = (Boolean)m.invoke(this, args[i]);
1748                     if (result != expected && WHITE_BOX.isMethodCompiled(m, false)) {
1749                         System.out.println(" = " + result);
1750                         throw new RuntimeException("Test failed: should return " + expected);
1751                     }
1752                 }
1753                 System.out.println(" = " + expected);
1754             } else {
1755                 // Equality checks
1756                 for (int j = 0; j < args.length; ++j) {
1757                     if (args[j] != null && !parameterTypes[1].isInstance(args[j])) {
1758                         continue;
1759                     }
1760                     if (args[j] == null && parameterTypes[1] == MyValue1.class.asValueType()) {
1761                         continue;
1762                     }
1763                     System.out.print("Testing " + m.getName() + "(" + args[i] + ", " + args[j] + ")");
1764                     // Avoid acmp in the computation of the expected result!
1765                     boolean equal = equalities[i][j];
1766                     equal = isNegated(m) ? !equal : equal;
1767                     boolean expected = ((i == 0 || j == 0) && trueIfNull(m)) || (equal && !(i == 0 && falseIfNull(m)));
1768                     for (int run = 0; run < warmup; ++run) {
1769                         Boolean result = (Boolean)m.invoke(this, args[i], args[j]);
1770                         if (result != expected && WHITE_BOX.isMethodCompiled(m, false) && warmup == 1) {
1771                             System.out.println(" = " + result);
1772                             throw new RuntimeException("Test failed: should return " + expected);
1773                         }
1774                     }
1775                     System.out.println(" = " + expected);
1776                 }
1777             }
1778         }
1779     }
1780 
1781     public void run(int nullMode) throws Exception {
1782         // Prepare test arguments
1783         Object[] args =  { null,
1784                            new Object(),
1785                            new MyObject(),
1786                            MyValue1.setX(MyValue1.createDefault(), 42),
1787                            new Object[10],
1788                            new MyObject[10],
1789                            MyValue1.setX(MyValue1.createDefault(), 0x42),
1790                            MyValue1.setX(MyValue1.createDefault(), 42),
1791                            MyValue2.setX(MyValue2.createDefault(), 42), };
1792 
1793         boolean[][] equalities = { { true,  false, false, false, false, false, false, false, false },
1794                                    { false, true,  false, false, false, false, false, false, false },
1795                                    { false, false, true,  false, false, false, false, false, false },
1796                                    { false, false, false, true,  false, false, false, true,  false },
1797                                    { false, false, false, false, true,  false, false, false, false },
1798                                    { false, false, false, false, false, true,  false, false, false },
1799                                    { false, false, false, false, false, false, true,  false, false },
1800                                    { false, false, false, true,  false, false, false, true,  false },
1801                                    { false, false, false, false, false, false, false, false, true  } };
1802 
1803         // Run tests
1804         for (Method m : getClass().getMethods()) {
1805             if (m.getName().startsWith("test")) {
1806                 // Do some warmup runs
1807                 runTest(m, args, 1000, nullMode, equalities);
1808                 // Make sure method is compiled
1809                 TestFramework.compile(m, CompLevel.ANY);
1810                 Asserts.assertTrue(WHITE_BOX.isMethodCompiled(m, false), m + " not compiled");
1811                 // Run again to verify correctness of compiled code
1812                 runTest(m, args, 1, nullMode, equalities);
1813             }
1814         }
1815 
1816         Method cmpAlwaysUnEqual3_m = getClass().getMethod("cmpAlwaysUnEqual3", Object.class);
1817         Method cmpAlwaysUnEqual4_m = getClass().getMethod("cmpAlwaysUnEqual4", Object.class);
1818         Method cmpSometimesEqual1_m = getClass().getMethod("cmpSometimesEqual1", Object.class);
1819         Method cmpSometimesEqual2_m = getClass().getMethod("cmpSometimesEqual2", Object.class);
1820 
1821         for (int i = 0; i < 20_000; ++i) {
1822             Asserts.assertTrue(cmpAlwaysEqual1(args[1], args[1]));
1823             Asserts.assertFalse(cmpAlwaysEqual2(args[1], args[1]));
1824             Asserts.assertTrue(cmpAlwaysEqual3(args[1]));
1825             Asserts.assertFalse(cmpAlwaysEqual4(args[1]));
1826 
1827             Asserts.assertFalse(cmpAlwaysUnEqual1(args[1], args[2]));
1828             Asserts.assertTrue(cmpAlwaysUnEqual2(args[1], args[2]));
1829             boolean res = cmpAlwaysUnEqual3(args[3]);
1830             Asserts.assertTrue(res);
1831             res = cmpAlwaysUnEqual4(args[3]);
1832             Asserts.assertFalse(res);
1833 
1834             int idx = i % args.length;
1835             res = cmpSometimesEqual1(args[idx]);
1836             Asserts.assertTrue(res);
1837             res = cmpSometimesEqual2(args[idx]);
1838             Asserts.assertFalse(res);
1839         }
1840     }
1841 
1842     public static void main(String[] args) throws Exception {
1843         if (args.length == 0) {
1844             enumerateVMOptions();
1845         } else {
1846             int nullMode = Integer.valueOf(args[0]);
1847             TestNewAcmp t = new TestNewAcmp();
1848             t.run(nullMode);
1849         }
1850     }
1851 
1852     private static String[] addOptions(String prefix[], String... extra) {
1853         ArrayList<String> list = new ArrayList<String>();
1854         if (prefix != null) {
1855             for (String s : prefix) {
1856                 list.add(s);
1857             }
1858         }
1859         if (extra != null) {
1860             for (String s : extra) {
1861                 System.out.println("    " + s);
1862                 list.add(s);
1863             }
1864         }
1865 
1866         return list.toArray(new String[list.size()]);
1867     }
1868 
1869     private static void enumerateVMOptions() throws Exception {
1870         String[] baseOptions = {
1871             "-Xbootclasspath/a:.",
1872             "-XX:+UnlockDiagnosticVMOptions",
1873             "-XX:+WhiteBoxAPI",
1874             "-Xbatch",
1875             "-XX:TypeProfileLevel=222",
1876             "-XX:CompileCommand=dontinline,compiler.valhalla.inlinetypes.TestNewAcmp::test*",
1877             "-XX:CompileCommand=dontinline,compiler.valhalla.inlinetypes.TestNewAcmp::cmp*"};
1878 
1879         String SCENARIOS = System.getProperty("Scenarios", "");
1880         List<String> scenarios = null;
1881         if (!SCENARIOS.isEmpty()) {
1882            scenarios = Arrays.asList(SCENARIOS.split(","));
1883         }
1884 
1885         int scenario = -1;
1886         for (int nullMode = 0; nullMode <= 2; nullMode++) {          // null mode
1887             for (int incrInline = 0; incrInline < 2; incrInline++) { // 0 = default, 1 = -XX:+AlwaysIncrementalInline
1888                 scenario++;
1889                 System.out.println("Scenario #" + scenario + " -------------------");
1890                 String[] cmds = baseOptions;
1891                 if (incrInline != 0) {
1892                     cmds = addOptions(cmds, "-XX:+IgnoreUnrecognizedVMOptions", "-XX:+AlwaysIncrementalInline");
1893                 }
1894 
1895                 cmds = addOptions(cmds, "compiler.valhalla.inlinetypes.TestNewAcmp");
1896                 cmds = addOptions(cmds, Integer.toString(nullMode));
1897 
1898                 if (scenarios != null && !scenarios.contains(Integer.toString(scenario))) {
1899                     System.out.println("Scenario #" + scenario + " is skipped due to -Dscenarios=" + SCENARIOS);
1900                     continue;
1901                 }
1902 
1903                 OutputAnalyzer oa = ProcessTools.executeTestJvm(cmds);
1904                 String output = oa.getOutput();
1905                 oa.shouldHaveExitValue(0);
1906                 System.out.println(output);
1907             }
1908         }
1909     }
1910 }