< prev index next >

hotspot/test/runtime/valhalla/valuetypes/VWithFieldTest.java

Print this page




  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 package runtime.valhalla.valuetypes;
  25 
  26 import jdk.test.lib.Asserts;
  27 
  28 /*
  29  * @test VWithFieldTest
  30  * @summary vwithfield bytecode test
  31  * @library /test/lib
  32  * @compile -XDenableValueTypes Point.java VWithFieldTest.java

  33  * @run main/othervm -Xint -XX:+EnableValhalla runtime.valhalla.valuetypes.VWithFieldTest
  34  * @run main/othervm -Xcomp -XX:+EnableValhalla runtime.valhalla.valuetypes.VWithFieldTest
  35  */
  36 
  37 public class VWithFieldTest {
  38 
  39     static __ByValue final class Point {
  40         final private int x;
  41         final private int y;
  42         
  43         __ValueFactory static Point make(int x, int y) {
  44             Point p = __MakeDefault Point();
  45             Asserts.assertEquals(p.x, 0, "invalid x default value");
  46             Asserts.assertEquals(p.y, 0, "invalid y default value");
  47             p.x = x;
  48             Asserts.assertEquals(p.x, x, "invalid x value");
  49             Asserts.assertEquals(p.y, 0, "invalid y value");
  50             p.y = y;
  51             Asserts.assertEquals(p.x, x, "invalid x value");
  52             Asserts.assertEquals(p.y, y, "invalid y value");




  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 package runtime.valhalla.valuetypes;
  25 
  26 import jdk.test.lib.Asserts;
  27 
  28 /*
  29  * @test VWithFieldTest
  30  * @summary vwithfield bytecode test
  31  * @library /test/lib
  32  * @compile -XDenableValueTypes --add-modules jdk.incubator.mvt Point.java
  33  * @compile -XDenableValueTypes VWithFieldTest.java
  34  * @run main/othervm -Xint -XX:+EnableValhalla runtime.valhalla.valuetypes.VWithFieldTest
  35  * @run main/othervm -Xcomp -XX:+EnableValhalla runtime.valhalla.valuetypes.VWithFieldTest
  36  */
  37 
  38 public class VWithFieldTest {
  39 
  40     static __ByValue final class Point {
  41         final private int x;
  42         final private int y;
  43         
  44         __ValueFactory static Point make(int x, int y) {
  45             Point p = __MakeDefault Point();
  46             Asserts.assertEquals(p.x, 0, "invalid x default value");
  47             Asserts.assertEquals(p.y, 0, "invalid y default value");
  48             p.x = x;
  49             Asserts.assertEquals(p.x, x, "invalid x value");
  50             Asserts.assertEquals(p.y, 0, "invalid y value");
  51             p.y = y;
  52             Asserts.assertEquals(p.x, x, "invalid x value");
  53             Asserts.assertEquals(p.y, y, "invalid y value");


< prev index next >