equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
23 |
23 |
24 /** |
24 /** |
25 * @test |
25 * @test |
26 * @bug 5057225 |
26 * @bug 5057225 |
27 * @summary Remove useless I2L conversions |
27 * @summary Remove useless I2L conversions |
28 * |
28 * @library /testlibrary |
29 * @run main/othervm -Xcomp -XX:CompileOnly=Test5057225.doload Test5057225 |
29 * @run main/othervm -Xcomp -XX:CompileOnly=Test5057225.doload Test5057225 |
30 */ |
30 */ |
31 |
31 |
32 import java.net.URLClassLoader; |
32 import jdk.test.lib.Utils; |
33 |
33 |
34 public class Test5057225 { |
34 public class Test5057225 { |
35 static byte[] ba = new byte[] { -1 }; |
35 static byte[] ba = new byte[] { -1 }; |
36 static short[] sa = new short[] { -1 }; |
36 static short[] sa = new short[] { -1 }; |
37 static int[] ia = new int[] { -1 }; |
37 static int[] ia = new int[] { -1 }; |
87 throw new InternalError(result + " != " + expected); |
87 throw new InternalError(result + " != " + expected); |
88 } |
88 } |
89 |
89 |
90 static void loadAndRunClass(String classname) throws Exception { |
90 static void loadAndRunClass(String classname) throws Exception { |
91 Class cl = Class.forName(classname); |
91 Class cl = Class.forName(classname); |
92 URLClassLoader apploader = (URLClassLoader) cl.getClassLoader(); |
92 ClassLoader apploader = cl.getClassLoader(); |
93 ClassLoader loader = new URLClassLoader(apploader.getURLs(), apploader.getParent()); |
93 ClassLoader loader |
|
94 = Utils.getTestClassPathURLClassLoader(apploader.getParent()); |
94 Class c = loader.loadClass(classname); |
95 Class c = loader.loadClass(classname); |
95 Runnable r = (Runnable) c.newInstance(); |
96 Runnable r = (Runnable) c.newInstance(); |
96 r.run(); |
97 r.run(); |
97 } |
98 } |
98 |
99 |