1 package runtime.valhalla.valuetypes;
   2 
   3 import jdk.test.lib.Asserts;
   4 
   5 /*
   6  * @test InvokeDirect
   7  * @summary Value Type invokedirect bytecode test (incomplete until type system defn done)
   8  * @library /testlibrary /
   9  * @run main/othervm -noverify runtime.valhalla.valuetypes.InvokeDirect
  10  */
  11 public class InvokeDirect {
  12     public static void main(String[] args) {
  13         InvokeDirect invokeDirect = new InvokeDirect();
  14         invokeDirect.run();
  15     }
  16 
  17     public void run() {
  18         testPoint();
  19     }
  20 
  21     public void testPoint() {
  22         int x = 1;
  23         int y = 2;
  24         Point p = Point.createPoint(x, y);
  25         Asserts.assertEquals(x, p.getX(), "Method result invalid");
  26         Asserts.assertEquals(y, p.getY(), "Method result invalid");
  27 
  28         // Just check we can call this...
  29         String s = p.toString();
  30 
  31         // See if we can GC from here then
  32         System.gc();
  33 
  34         Point samePoint = Point.createPoint(p.getX(), p.getY());
  35         boolean isSamePoint = p.isSamePoint(samePoint);
  36         Asserts.assertTrue(isSamePoint, "Should be the same");
  37     }
  38 
  39 }