Mercurial > hg > truffle
annotate test/compiler/6991596/Test6991596.java @ 2211:0cd39a385a72
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@gmail.com> |
---|---|
date | Mon, 21 Feb 2011 19:17:33 +0100 |
parents | b856cd7f4e60 |
children |
rev | line source |
---|---|
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
1 /* |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
2 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
4 * |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
8 * |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
13 * accompanied this code). |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
14 * |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
18 * |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
21 * questions. |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
22 * |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
23 */ |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
24 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
25 /** |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
26 * @test |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
27 * @bug 6991596 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
28 * @summary JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
29 * |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
30 * @run main/othervm -ea -XX:+UnlockExperimentalVMOptions -XX:+EnableMethodHandles -XX:+EnableInvokeDynamic -XX:+UnlockDiagnosticVMOptions -XX:+VerifyMethodHandles Test6991596 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
31 */ |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
32 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
33 import java.dyn.*; |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
34 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
35 public class Test6991596 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
36 private static final Class CLASS = Test6991596.class; |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
37 private static final String NAME = "foo"; |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
38 private static final boolean DEBUG = System.getProperty("DEBUG", "false").equals("true"); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
39 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
40 public static void main(String[] args) throws Throwable { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
41 testboolean(); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
42 testbyte(); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
43 testchar(); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
44 testshort(); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
45 testint(); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
46 testlong(); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
47 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
48 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
49 // Helpers to get various methods. |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
50 static MethodHandle getmh1(Class ret, Class arg) throws NoAccessException { |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
51 return MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(ret, arg)); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
52 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
53 static MethodHandle getmh2(MethodHandle mh1, Class ret, Class arg) { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
54 return MethodHandles.convertArguments(mh1, MethodType.methodType(ret, arg)); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
55 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
56 static MethodHandle getmh3(MethodHandle mh1, Class ret, Class arg) { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
57 return MethodHandles.convertArguments(mh1, MethodType.methodType(ret, arg)); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
58 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
59 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
60 // test adapter_opt_i2i |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
61 static void testboolean() throws Throwable { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
62 boolean[] a = new boolean[] { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
63 true, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
64 false |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
65 }; |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
66 for (int i = 0; i < a.length; i++) { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
67 doboolean(a[i]); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
68 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
69 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
70 static void doboolean(boolean x) throws Throwable { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
71 if (DEBUG) System.out.println("boolean=" + x); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
72 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
73 // boolean |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
74 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
75 MethodHandle mh1 = getmh1( boolean.class, boolean.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
76 MethodHandle mh2 = getmh2(mh1, boolean.class, boolean.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
77 // TODO add this for all cases when the bugs are fixed. |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
78 //MethodHandle mh3 = getmh3(mh1, boolean.class, boolean.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
79 boolean a = (boolean) mh1.invokeExact((boolean) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
80 boolean b = (boolean) mh2.invokeExact(x); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
81 //boolean c = mh3.<boolean>invokeExact((boolean) x); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
82 check(x, a, b); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
83 //check(x, c, x); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
84 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
85 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
86 // byte |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
87 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
88 MethodHandle mh1 = getmh1( byte.class, byte.class ); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
89 MethodHandle mh2 = getmh2(mh1, byte.class, boolean.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
90 byte a = (byte) mh1.invokeExact((byte) (x ? 1 : 0)); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
91 byte b = (byte) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
92 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
93 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
94 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
95 // char |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
96 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
97 MethodHandle mh1 = getmh1( char.class, char.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
98 MethodHandle mh2 = getmh2(mh1, char.class, boolean.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
99 char a = (char) mh1.invokeExact((char) (x ? 1 : 0)); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
100 char b = (char) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
101 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
102 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
103 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
104 // short |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
105 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
106 MethodHandle mh1 = getmh1( short.class, short.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
107 MethodHandle mh2 = getmh2(mh1, short.class, boolean.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
108 short a = (short) mh1.invokeExact((short) (x ? 1 : 0)); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
109 short b = (short) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
110 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
111 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
112 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
113 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
114 static void testbyte() throws Throwable { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
115 byte[] a = new byte[] { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
116 Byte.MIN_VALUE, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
117 Byte.MIN_VALUE + 1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
118 -0x0F, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
119 -1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
120 0, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
121 1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
122 0x0F, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
123 Byte.MAX_VALUE - 1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
124 Byte.MAX_VALUE |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
125 }; |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
126 for (int i = 0; i < a.length; i++) { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
127 dobyte(a[i]); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
128 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
129 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
130 static void dobyte(byte x) throws Throwable { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
131 if (DEBUG) System.out.println("byte=" + x); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
132 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
133 // boolean |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
134 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
135 MethodHandle mh1 = getmh1( boolean.class, boolean.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
136 MethodHandle mh2 = getmh2(mh1, boolean.class, byte.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
137 boolean a = (boolean) mh1.invokeExact((x & 1) == 1); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
138 boolean b = (boolean) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
139 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
140 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
141 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
142 // byte |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
143 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
144 MethodHandle mh1 = getmh1( byte.class, byte.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
145 MethodHandle mh2 = getmh2(mh1, byte.class, byte.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
146 byte a = (byte) mh1.invokeExact((byte) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
147 byte b = (byte) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
148 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
149 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
150 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
151 // char |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
152 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
153 MethodHandle mh1 = getmh1( char.class, char.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
154 MethodHandle mh2 = getmh2(mh1, char.class, byte.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
155 char a = (char) mh1.invokeExact((char) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
156 char b = (char) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
157 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
158 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
159 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
160 // short |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
161 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
162 MethodHandle mh1 = getmh1( short.class, short.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
163 MethodHandle mh2 = getmh2(mh1, short.class, byte.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
164 short a = (short) mh1.invokeExact((short) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
165 short b = (short) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
166 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
167 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
168 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
169 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
170 static void testchar() throws Throwable { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
171 char[] a = new char[] { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
172 Character.MIN_VALUE, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
173 Character.MIN_VALUE + 1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
174 0x000F, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
175 0x00FF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
176 0x0FFF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
177 Character.MAX_VALUE - 1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
178 Character.MAX_VALUE |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
179 }; |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
180 for (int i = 0; i < a.length; i++) { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
181 dochar(a[i]); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
182 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
183 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
184 static void dochar(char x) throws Throwable { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
185 if (DEBUG) System.out.println("char=" + x); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
186 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
187 // boolean |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
188 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
189 MethodHandle mh1 = getmh1( boolean.class, boolean.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
190 MethodHandle mh2 = getmh2(mh1, boolean.class, char.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
191 boolean a = (boolean) mh1.invokeExact((x & 1) == 1); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
192 boolean b = (boolean) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
193 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
194 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
195 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
196 // byte |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
197 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
198 MethodHandle mh1 = getmh1( byte.class, byte.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
199 MethodHandle mh2 = getmh2(mh1, byte.class, char.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
200 byte a = (byte) mh1.invokeExact((byte) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
201 byte b = (byte) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
202 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
203 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
204 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
205 // char |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
206 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
207 MethodHandle mh1 = getmh1( char.class, char.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
208 MethodHandle mh2 = getmh2(mh1, char.class, char.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
209 char a = (char) mh1.invokeExact((char) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
210 char b = (char) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
211 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
212 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
213 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
214 // short |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
215 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
216 MethodHandle mh1 = getmh1( short.class, short.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
217 MethodHandle mh2 = getmh2(mh1, short.class, char.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
218 short a = (short) mh1.invokeExact((short) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
219 short b = (short) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
220 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
221 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
222 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
223 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
224 static void testshort() throws Throwable { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
225 short[] a = new short[] { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
226 Short.MIN_VALUE, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
227 Short.MIN_VALUE + 1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
228 -0x0FFF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
229 -0x00FF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
230 -0x000F, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
231 -1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
232 0, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
233 1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
234 0x000F, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
235 0x00FF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
236 0x0FFF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
237 Short.MAX_VALUE - 1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
238 Short.MAX_VALUE |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
239 }; |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
240 for (int i = 0; i < a.length; i++) { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
241 doshort(a[i]); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
242 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
243 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
244 static void doshort(short x) throws Throwable { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
245 if (DEBUG) System.out.println("short=" + x); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
246 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
247 // boolean |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
248 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
249 MethodHandle mh1 = getmh1( boolean.class, boolean.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
250 MethodHandle mh2 = getmh2(mh1, boolean.class, short.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
251 boolean a = (boolean) mh1.invokeExact((x & 1) == 1); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
252 boolean b = (boolean) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
253 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
254 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
255 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
256 // byte |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
257 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
258 MethodHandle mh1 = getmh1( byte.class, byte.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
259 MethodHandle mh2 = getmh2(mh1, byte.class, short.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
260 byte a = (byte) mh1.invokeExact((byte) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
261 byte b = (byte) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
262 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
263 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
264 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
265 // char |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
266 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
267 MethodHandle mh1 = getmh1( char.class, char.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
268 MethodHandle mh2 = getmh2(mh1, char.class, short.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
269 char a = (char) mh1.invokeExact((char) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
270 char b = (char) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
271 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
272 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
273 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
274 // short |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
275 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
276 MethodHandle mh1 = getmh1( short.class, short.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
277 MethodHandle mh2 = getmh2(mh1, short.class, short.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
278 short a = (short) mh1.invokeExact((short) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
279 short b = (short) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
280 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
281 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
282 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
283 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
284 static void testint() throws Throwable { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
285 int[] a = new int[] { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
286 Integer.MIN_VALUE, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
287 Integer.MIN_VALUE + 1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
288 -0x0FFFFFFF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
289 -0x00FFFFFF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
290 -0x000FFFFF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
291 -0x0000FFFF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
292 -0x00000FFF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
293 -0x000000FF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
294 -0x0000000F, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
295 -1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
296 0, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
297 1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
298 0x0000000F, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
299 0x000000FF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
300 0x00000FFF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
301 0x0000FFFF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
302 0x000FFFFF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
303 0x00FFFFFF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
304 0x0FFFFFFF, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
305 Integer.MAX_VALUE - 1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
306 Integer.MAX_VALUE |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
307 }; |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
308 for (int i = 0; i < a.length; i++) { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
309 doint(a[i]); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
310 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
311 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
312 static void doint(int x) throws Throwable { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
313 if (DEBUG) System.out.println("int=" + x); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
314 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
315 // boolean |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
316 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
317 MethodHandle mh1 = getmh1( boolean.class, boolean.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
318 MethodHandle mh2 = getmh2(mh1, boolean.class, int.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
319 boolean a = (boolean) mh1.invokeExact((x & 1) == 1); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
320 boolean b = (boolean) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
321 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
322 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
323 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
324 // byte |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
325 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
326 MethodHandle mh1 = getmh1( byte.class, byte.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
327 MethodHandle mh2 = getmh2(mh1, byte.class, int.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
328 byte a = (byte) mh1.invokeExact((byte) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
329 byte b = (byte) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
330 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
331 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
332 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
333 // char |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
334 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
335 MethodHandle mh1 = getmh1( char.class, char.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
336 MethodHandle mh2 = getmh2(mh1, char.class, int.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
337 char a = (char) mh1.invokeExact((char) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
338 char b = (char) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
339 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
340 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
341 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
342 // short |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
343 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
344 MethodHandle mh1 = getmh1( short.class, short.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
345 MethodHandle mh2 = getmh2(mh1, short.class, int.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
346 short a = (short) mh1.invokeExact((short) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
347 short b = (short) mh2.invokeExact(x); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
348 assert a == b : a + " != " + b; |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
349 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
350 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
351 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
352 // int |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
353 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
354 MethodHandle mh1 = getmh1( int.class, int.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
355 MethodHandle mh2 = getmh2(mh1, int.class, int.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
356 int a = (int) mh1.invokeExact((int) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
357 int b = (int) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
358 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
359 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
360 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
361 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
362 // test adapter_opt_l2i |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
363 static void testlong() throws Throwable { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
364 long[] a = new long[] { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
365 Long.MIN_VALUE, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
366 Long.MIN_VALUE + 1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
367 -0x000000000FFFFFFFL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
368 -0x0000000000FFFFFFL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
369 -0x00000000000FFFFFL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
370 -0x000000000000FFFFL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
371 -0x0000000000000FFFL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
372 -0x00000000000000FFL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
373 -0x000000000000000FL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
374 -1L, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
375 0L, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
376 1L, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
377 0x000000000000000FL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
378 0x00000000000000FFL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
379 0x0000000000000FFFL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
380 0x0000000000000FFFL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
381 0x000000000000FFFFL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
382 0x00000000000FFFFFL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
383 0x0000000000FFFFFFL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
384 0x000000000FFFFFFFL, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
385 Long.MAX_VALUE - 1, |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
386 Long.MAX_VALUE |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
387 }; |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
388 for (int i = 0; i < a.length; i++) { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
389 dolong(a[i]); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
390 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
391 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
392 static void dolong(long x) throws Throwable { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
393 if (DEBUG) System.out.println("long=" + x); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
394 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
395 // boolean |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
396 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
397 MethodHandle mh1 = getmh1( boolean.class, boolean.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
398 MethodHandle mh2 = getmh2(mh1, boolean.class, long.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
399 boolean a = (boolean) mh1.invokeExact((x & 1L) == 1L); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
400 boolean b = (boolean) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
401 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
402 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
403 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
404 // byte |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
405 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
406 MethodHandle mh1 = getmh1( byte.class, byte.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
407 MethodHandle mh2 = getmh2(mh1, byte.class, long.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
408 byte a = (byte) mh1.invokeExact((byte) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
409 byte b = (byte) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
410 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
411 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
412 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
413 // char |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
414 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
415 MethodHandle mh1 = getmh1( char.class, char.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
416 MethodHandle mh2 = getmh2(mh1, char.class, long.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
417 char a = (char) mh1.invokeExact((char) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
418 char b = (char) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
419 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
420 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
421 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
422 // short |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
423 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
424 MethodHandle mh1 = getmh1( short.class, short.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
425 MethodHandle mh2 = getmh2(mh1, short.class, long.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
426 short a = (short) mh1.invokeExact((short) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
427 short b = (short) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
428 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
429 } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
430 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
431 // int |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
432 { |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
433 MethodHandle mh1 = getmh1( int.class, int.class); |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
434 MethodHandle mh2 = getmh2(mh1, int.class, long.class); |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
435 int a = (int) mh1.invokeExact((int) x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
436 int b = (int) mh2.invokeExact(x); |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
437 check(x, a, b); |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
438 } |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
439 } |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
440 |
2009
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
441 static void check(boolean x, boolean e, boolean a) { p(z2h(x), z2h(e), z2h(a)); assert e == a : z2h(x) + ": " + z2h(e) + " != " + z2h(a); } |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
442 static void check(boolean x, byte e, byte a) { p(z2h(x), i2h(e), i2h(a)); assert e == a : z2h(x) + ": " + i2h(e) + " != " + i2h(a); } |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
443 static void check(boolean x, int e, int a) { p(z2h(x), i2h(e), i2h(a)); assert e == a : z2h(x) + ": " + i2h(e) + " != " + i2h(a); } |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
444 |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
445 static void check(int x, boolean e, boolean a) { p(i2h(x), z2h(e), z2h(a)); assert e == a : i2h(x) + ": " + z2h(e) + " != " + z2h(a); } |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
446 static void check(int x, byte e, byte a) { p(i2h(x), i2h(e), i2h(a)); assert e == a : i2h(x) + ": " + i2h(e) + " != " + i2h(a); } |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
447 static void check(int x, int e, int a) { p(i2h(x), i2h(e), i2h(a)); assert e == a : i2h(x) + ": " + i2h(e) + " != " + i2h(a); } |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
448 |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
449 static void check(long x, boolean e, boolean a) { p(l2h(x), z2h(e), z2h(a)); assert e == a : l2h(x) + ": " + z2h(e) + " != " + z2h(a); } |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
450 static void check(long x, byte e, byte a) { p(l2h(x), i2h(e), i2h(a)); assert e == a : l2h(x) + ": " + i2h(e) + " != " + i2h(a); } |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
451 static void check(long x, int e, int a) { p(l2h(x), i2h(e), i2h(a)); assert e == a : l2h(x) + ": " + i2h(e) + " != " + i2h(a); } |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
452 |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
453 static void p(String x, String e, String a) { if (DEBUG) System.out.println(x + ": expected: " + e + ", actual: " + a); } |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
454 |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
455 static String z2h(boolean x) { return x ? "1" : "0"; } |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
456 static String i2h(int x) { return Integer.toHexString(x); } |
b856cd7f4e60
7003798: test/compiler/6991596 fails with true != false
twisti
parents:
1901
diff
changeset
|
457 static String l2h(long x) { return Long.toHexString(x); } |
1901
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
458 |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
459 // to int |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
460 public static boolean foo(boolean i) { return i; } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
461 public static byte foo(byte i) { return i; } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
462 public static char foo(char i) { return i; } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
463 public static short foo(short i) { return i; } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
464 public static int foo(int i) { return i; } |
7aff5786cc02
6991596: JSR 292 unimplemented adapter_opt_i2i and adapter_opt_l2i on SPARC
twisti
parents:
diff
changeset
|
465 } |