Mercurial > hg > graal-jvmci-8
annotate test/testlibrary_tests/RedefineClassTest.java @ 23940:f958bebdee26 jdk8u92-b32
8063086: Math.pow yields different results upon repeated calls
Summary: C2 treats x^2 as a special case and computes x * x while the interpreter and c1 don't have special case code for X^2.
Reviewed-by: kvn
author | csahu |
---|---|
date | Tue, 24 May 2016 17:49:06 +0530 |
parents | 3e5e398431a8 |
children |
rev | line source |
---|---|
23183
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
1 /* |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
4 * |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
8 * |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
13 * accompanied this code). |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
14 * |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
18 * |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
21 * questions. |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
22 */ |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
23 |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
24 /* |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
25 * @test |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
26 * @library /testlibrary |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
27 * @summary Proof of concept test for RedefineClassHelper |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
28 * @build RedefineClassHelper |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
29 * @run main RedefineClassHelper |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
30 * @run main/othervm -javaagent:redefineagent.jar RedefineClassTest |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
31 */ |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
32 |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
33 import static com.oracle.java.testlibrary.Asserts.*; |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
34 import com.oracle.java.testlibrary.*; |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
35 |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
36 /* |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
37 * Proof of concept test for the test utility class RedefineClassHelper |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
38 */ |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
39 public class RedefineClassTest { |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
40 |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
41 public static String newClass = "class RedefineClassTest$A { public int Method() { return 2; } }"; |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
42 public static void main(String[] args) throws Exception { |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
43 A a = new A(); |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
44 assertTrue(a.Method() == 1); |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
45 RedefineClassHelper.redefineClass(A.class, newClass); |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
46 assertTrue(a.Method() == 2); |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
47 } |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
48 |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
49 static class A { |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
50 public int Method() { |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
51 return 1; |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
52 } |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
53 } |
3e5e398431a8
8044364: runtime/RedefineFinalizer test fails on windows
ctornqvi
parents:
diff
changeset
|
54 } |