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 package runtime.valhalla.valuetypes;
24
25 import jdk.test.lib.Asserts;
26
27 /*
28 * @test ValueTypeCreation
29 * @summary Value Type creation test
30 * @library /test/lib
31 * @compile -XDenableValueTypes ValueTypeCreation.java Point.java Long8Value.java Person.java
32 * @run main/othervm -Xint -XX:+EnableValhalla runtime.valhalla.valuetypes.ValueTypeCreation
33 * @run main/othervm -Xcomp -XX:+EnableValhalla runtime.valhalla.valuetypes.ValueTypeCreation
34 */
35 public class ValueTypeCreation {
36 public static void main(String[] args) {
37 ValueTypeCreation valueTypeCreation = new ValueTypeCreation();
38 valueTypeCreation.run();
39 }
40
41 public void run() {
42 testPoint();
43 testLong8();
44 // Embedded oops not yet supported
45 //testPerson();
46 StaticSelf.test();
47 }
48
49 void testPoint() {
50 Point p = Point.createPoint(1, 2);
51 Asserts.assertEquals(p.x, 1, "invalid point x value");
52 Asserts.assertEquals(p.y, 2, "invalid point 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 package runtime.valhalla.valuetypes;
24
25 import jdk.test.lib.Asserts;
26
27 /*
28 * @test ValueTypeCreation
29 * @summary Value Type creation test
30 * @library /test/lib
31 * @compile -XDenableValueTypes ValueTypeCreation.java Point.java Long8Value.java Person.java
32 * @run main/othervm -Xint -XX:+EnableValhalla -XX:+PrintValueLayout runtime.valhalla.valuetypes.ValueTypeCreation
33 */
34
35
36
37
38
39
40 /*
41 * @run main/othervm -Xcomp -XX:+EnableValhalla runtime.valhalla.valuetypes.ValueTypeCreation
42 */
43 public class ValueTypeCreation {
44 public static void main(String[] args) {
45 ValueTypeCreation valueTypeCreation = new ValueTypeCreation();
46 valueTypeCreation.run();
47 }
48
49 public void run() {
50 testPoint();
51 testLong8();
52 // Embedded oops not yet supported
53 //testPerson();
54 StaticSelf.test();
55 }
56
57 void testPoint() {
58 Point p = Point.createPoint(1, 2);
59 Asserts.assertEquals(p.x, 1, "invalid point x value");
60 Asserts.assertEquals(p.y, 2, "invalid point y value");
|