import jdk.internal.vm.annotation.*;

// Crash with -XX:+UseAtomicValueFlattening -XX:+VerifyAdapterSharing
public class Test2 {
    static abstract value class MyAbstract {
        int i;

        MyAbstract(int i) {
            this.i = i;
        }
    }
    static value class MyValue1 extends MyAbstract {
        MyValue1(int i) {
            super(i);
        }

        void test() {}
    }

    static value class Empty {
    }

    public static value class MyValue2 {
        @NullRestricted
        @Strict
        Empty e;
        int i;

        MyValue2(int i) {
            this.e = new Empty();
            this.i = i;
        }

        void test() {}
    }

    public static void main(String[] args) {
        MyValue1 v1 = new MyValue1(0);
        v1.test();
        MyValue2 v2 = new MyValue2(0);
        v2.test();
    }
}
