annotate test/compiler/osr/TestRangeCheck.java @ 21784:f4e1d958f1c3

[AMD64] Create AMD64 specific address nodes.
author Roland Schatz <roland.schatz@oracle.com>
date Mon, 08 Jun 2015 19:19:45 +0200
parents 1b8c9d3d8764
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20521
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
1 /*
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
4 *
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
7 * published by the Free Software Foundation.
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
8 *
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
13 * accompanied this code).
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
14 *
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
18 *
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
21 * questions.
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
22 */
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
23
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
24 /*
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
25 * @test TestRangeCheck
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
26 * @bug 8054883
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
27 * @summary Tests that range check is not skipped
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
28 */
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
29
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
30 public class TestRangeCheck {
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
31 public static void main(String args[]) {
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
32 try {
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
33 test();
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
34 throw new AssertionError("Expected ArrayIndexOutOfBoundsException was not thrown");
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
35 } catch (ArrayIndexOutOfBoundsException e) {
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
36 System.out.println("Expected ArrayIndexOutOfBoundsException was thrown");
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
37 }
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
38 }
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
39
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
40 private static void test() {
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
41 int arr[] = new int[1];
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
42 int result = 1;
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
43
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
44 // provoke OSR compilation
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
45 for (int i = 0; i < Integer.MAX_VALUE; i++) {
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
46 }
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
47
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
48 if (result > 0 && arr[~result] > 0) {
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
49 arr[~result] = 0;
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
50 }
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
51 }
1b8c9d3d8764 8057165: [TESTBUG] Need a test to cover JDK-8054883
iignatyev
parents:
diff changeset
52 }