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 /testlibrary /
32 * @run main/othervm -noverify -Xint runtime.valhalla.valuetypes.VWithFieldTest
33 */
34
35 public class VWithFieldTest {
36
37 static __ByValue final class Point {
38 final private int x;
39 final private int y;
40
41 __ValueFactory static Point make(int x, int y) {
42 Point p = __MakeDefault Point();
43 Asserts.assertEquals(p.x, 0, "invalid x default value");
44 Asserts.assertEquals(p.y, 0, "invalid y default value");
45 p.x = x;
46 Asserts.assertEquals(p.x, x, "invalid x value");
47 Asserts.assertEquals(p.y, 0, "invalid y value");
48 p.y = y;
49 Asserts.assertEquals(p.x, x, "invalid x value");
50 Asserts.assertEquals(p.y, y, "invalid y value");
51 return p;
52 }
|
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 /testlibrary /
32 * @run main/othervm -noverify -Xint runtime.valhalla.valuetypes.VWithFieldTest
33 * @run main/othervm -noverify -Xcomp runtime.valhalla.valuetypes.VWithFieldTest
34 */
35
36 public class VWithFieldTest {
37
38 static __ByValue final class Point {
39 final private int x;
40 final private int y;
41
42 __ValueFactory static Point make(int x, int y) {
43 Point p = __MakeDefault Point();
44 Asserts.assertEquals(p.x, 0, "invalid x default value");
45 Asserts.assertEquals(p.y, 0, "invalid y default value");
46 p.x = x;
47 Asserts.assertEquals(p.x, x, "invalid x value");
48 Asserts.assertEquals(p.y, 0, "invalid y value");
49 p.y = y;
50 Asserts.assertEquals(p.x, x, "invalid x value");
51 Asserts.assertEquals(p.y, y, "invalid y value");
52 return p;
53 }
|