Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java @ 24137:6523380966cd
Merge.
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Fri, 19 May 2017 14:05:50 +0200 |
parents | 1d4ce2d19e52 |
children |
rev | line source |
---|---|
16037 | 1 /* |
22518
37d2643aa69a
Add jtreg annotations to some tests
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
2 * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. |
16037 | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
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 */ | |
22518
37d2643aa69a
Add jtreg annotations to some tests
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
23 |
37d2643aa69a
Add jtreg annotations to some tests
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
24 /** |
37d2643aa69a
Add jtreg annotations to some tests
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
25 * @test |
37d2643aa69a
Add jtreg annotations to some tests
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
26 * @compile ConstantTest.java FieldUniverse.java TypeUniverse.java TestMetaAccessProvider.java |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22569
diff
changeset
|
27 * @run junit jdk.vm.ci.runtime.test.ConstantTest |
22518
37d2643aa69a
Add jtreg annotations to some tests
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
28 */ |
37d2643aa69a
Add jtreg annotations to some tests
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22054
diff
changeset
|
29 |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22569
diff
changeset
|
30 package jdk.vm.ci.runtime.test; |
16037 | 31 |
22569
ec96f33a101d
updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents:
22536
diff
changeset
|
32 import org.junit.Assert; |
ec96f33a101d
updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents:
22536
diff
changeset
|
33 import org.junit.Test; |
16037 | 34 |
23393
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
35 import jdk.vm.ci.meta.JavaConstant; |
1d4ce2d19e52
clean up and minimize JVMCI (JDK-8156835)
Doug Simon <doug.simon@oracle.com>
parents:
22672
diff
changeset
|
36 |
16037 | 37 public class ConstantTest extends FieldUniverse { |
38 | |
39 @Test | |
40 public void testNegativeZero() { | |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
16037
diff
changeset
|
41 Assert.assertTrue("Constant for 0.0f must be different from -0.0f", JavaConstant.FLOAT_0 != JavaConstant.forFloat(-0.0F)); |
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
16037
diff
changeset
|
42 Assert.assertTrue("Constant for 0.0d must be different from -0.0d", JavaConstant.DOUBLE_0 != JavaConstant.forDouble(-0.0d)); |
16037 | 43 } |
44 | |
45 @Test | |
46 public void testNullIsNull() { | |
18490
ca81508f2a19
Generalize NULL handling to work on arbitrary pointers.
Roland Schatz <roland.schatz@oracle.com>
parents:
18187
diff
changeset
|
47 Assert.assertTrue(JavaConstant.NULL_POINTER.isNull()); |
16037 | 48 } |
49 } |