annotate test/compiler/types/TestMeetExactConstantArrays.java @ 24155:88bd5f7522a1 jvmci-0.30

update hgignore and undo change to hotspot/.project
author Doug Simon <doug.simon@oracle.com>
date Fri, 07 Jul 2017 15:08:58 +0200
parents 2163da41681e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22943
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
1 /*
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
4 *
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
7 * published by the Free Software Foundation.
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
8 *
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
13 * accompanied this code).
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
14 *
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
18 *
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
21 * questions.
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
22 */
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
23
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
24 /*
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
25 * @test
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
26 * @bug 8075587
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
27 * @summary meet of 2 constant arrays result in bottom
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
28 * @run main/othervm TestMeetExactConstantArrays
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
29 *
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
30 */
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
31
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
32 public class TestMeetExactConstantArrays {
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
33 public abstract static class NumbersHolder {
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
34 public Number[] getNumbers() {
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
35 return null;
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
36 }
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
37 }
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
38
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
39 public static class IntegersHolder extends NumbersHolder {
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
40 private final static Integer integers[] = { new Integer(1) };
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
41
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
42 public Number[] getNumbers() {
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
43 return integers;
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
44 }
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
45 }
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
46
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
47 public static class LongsHolder extends NumbersHolder {
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
48 private final static Long longs[] = { new Long(1) };
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
49
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
50 public Number[] getNumbers() {
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
51 return longs;
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
52 }
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
53 }
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
54
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
55 public static final void loopNumbers(NumbersHolder numbersHolder) {
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
56 Number[] numbers = numbersHolder.getNumbers();
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
57 for (int i = 0; i < numbers.length; i++) {
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
58 numbers[i].longValue();
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
59 }
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
60 }
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
61
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
62 public static void main(String[] args) throws Exception {
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
63 for (int i = 0; i < 10000; i++) {
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
64 IntegersHolder integersHolder = new IntegersHolder();
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
65 LongsHolder longsHolder = new LongsHolder();
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
66 loopNumbers(integersHolder);
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
67 loopNumbers(longsHolder);
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
68 }
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
69 }
2163da41681e 8075587: Compilation of constant array containing different sub classes crashes the JVM
roland
parents:
diff changeset
70 }