// java -Xbatch -XX:-TieredCompilation -XX:CompileCommand=printcompilation,\*,\* -XX:CompileCommand=compileonly,Test.test --enable-preview -XX:+StressUnstableIfTraps -XX:StressSeed=3862475856 Test.java
// Instead of the stress seed repeating the compilation 100 times works as well

public class Test {

    public static final int     EQUAL = 1136052761;
    public static final int NOT_EQUAL = -2109960042;

    static value class MyValue {
        int x;

        public MyValue(int x) {
            this.x = x;
        }
    }

    public static void main(String[] args) {
        MyValue val = new MyValue(EQUAL);
        MyValue val_copy = new MyValue(EQUAL);
        MyValue val_diff = new MyValue(EQUAL + 1);

        test(val, val_copy, val_diff);
    }

    public static void test(MyValue val, MyValue val_copy, MyValue val_diff) {
        for (int i = 0; i < 50_000; ++i) {
            if (val != val_copy) {
                return;
            }
            if (val == val_diff) {
                return;
            }
        }
    }
}