package runtime.valhalla.valuetypes; import jdk.test.lib.Asserts; /* * @test InvokeDirect * @summary Value Type invokedirect bytecode test (incomplete until type system defn done) * @library /testlibrary / * @run main/othervm -noverify -Xint runtime.valhalla.valuetypes.InvokeDirect * @run main/othervm -noverify -Xcomp runtime.valhalla.valuetypes.InvokeDirect */ public class InvokeDirect { public static void main(String[] args) { InvokeDirect invokeDirect = new InvokeDirect(); invokeDirect.run(); } public void run() { testPoint(); } public void testPoint() { int x = 1; int y = 2; Point p = Point.createPoint(x, y); Asserts.assertEquals(x, p.getX(), "Method result invalid"); Asserts.assertEquals(y, p.getY(), "Method result invalid"); // Just check we can call this... String s = p.toString(); // See if we can GC from here then System.gc(); Point samePoint = Point.createPoint(p.getX(), p.getY()); boolean isSamePoint = p.isSamePoint(samePoint); Asserts.assertTrue(isSamePoint, "Should be the same"); } }