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 */
23
24 /*
25 * @test
26 * @bug 8130832
27 * @modules java.base/jdk.internal.misc
28 * @library /testlibrary /test/lib /
29 * @build IntrinsicAvailableTest
30 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
31 * sun.hotspot.WhiteBox$WhiteBoxPermission
32 * @run main/othervm -Xbootclasspath/a:.
33 * -XX:+UnlockDiagnosticVMOptions
34 * -XX:+WhiteBoxAPI
35 * -XX:+UseCRC32Intrinsics
36 * IntrinsicAvailableTest
37 * @run main/othervm -Xbootclasspath/a:.
38 * -XX:+UnlockDiagnosticVMOptions
39 * -XX:+WhiteBoxAPI
40 * -XX:-UseCRC32Intrinsics
41 * IntrinsicAvailableTest
42 */
43
44 import java.lang.reflect.Executable;
45 import java.util.concurrent.Callable;
46 import java.util.Objects;
47
48 import jdk.test.lib.*;
49 import compiler.whitebox.CompilerWhiteBoxTest;
50
51 public class IntrinsicAvailableTest extends CompilerWhiteBoxTest {
52 protected String VMName;
53
54 public IntrinsicAvailableTest(IntrinsicAvailableTestTestCase testCase) {
55 super(testCase);
56 VMName = System.getProperty("java.vm.name");
57 }
58
59 public static class IntrinsicAvailableTestTestCase implements TestCase {
60
61 public String name() {
62 return "IntrinsicAvailableTestTestCase";
63 }
64
65 public Executable getExecutable() {
66 // Using a single method to test the
67 // WhiteBox.isIntrinsicAvailable(Executable method, int compLevel)
68 // call for the compilation level corresponding to both the C1 and C2
69 // compiler keeps the current test simple.
70 //
|
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 */
23
24 /*
25 * @test
26 * @bug 8130832
27 * @modules java.base/jdk.internal.misc
28 * @library /testlibrary /test/lib /
29 *
30 * @build compiler.intrinsics.IntrinsicAvailableTest
31 * @run driver ClassFileInstaller sun.hotspot.WhiteBox
32 * sun.hotspot.WhiteBox$WhiteBoxPermission
33 * @run main/othervm -Xbootclasspath/a:.
34 * -XX:+UnlockDiagnosticVMOptions
35 * -XX:+WhiteBoxAPI
36 * -XX:+UseCRC32Intrinsics
37 * compiler.intrinsics.IntrinsicAvailableTest
38 * @run main/othervm -Xbootclasspath/a:.
39 * -XX:+UnlockDiagnosticVMOptions
40 * -XX:+WhiteBoxAPI
41 * -XX:-UseCRC32Intrinsics
42 * compiler.intrinsics.IntrinsicAvailableTest
43 */
44
45
46 package compiler.intrinsics;
47
48 import compiler.whitebox.CompilerWhiteBoxTest;
49 import jdk.test.lib.Platform;
50
51 import java.lang.reflect.Executable;
52 import java.util.concurrent.Callable;
53
54 public class IntrinsicAvailableTest extends CompilerWhiteBoxTest {
55 protected String VMName;
56
57 public IntrinsicAvailableTest(IntrinsicAvailableTestTestCase testCase) {
58 super(testCase);
59 VMName = System.getProperty("java.vm.name");
60 }
61
62 public static class IntrinsicAvailableTestTestCase implements TestCase {
63
64 public String name() {
65 return "IntrinsicAvailableTestTestCase";
66 }
67
68 public Executable getExecutable() {
69 // Using a single method to test the
70 // WhiteBox.isIntrinsicAvailable(Executable method, int compLevel)
71 // call for the compilation level corresponding to both the C1 and C2
72 // compiler keeps the current test simple.
73 //
|