hotspot/test/compiler/loopopts/Test6860469.java
author tpivovarova
Tue, 12 Jul 2016 18:24:48 +0300
changeset 40059 c2304140ed64
parent 27699 hotspot/test/compiler/loopopts/6860469/Test.java@9913b19c0948
permissions -rw-r--r--
8132919: Put compiler tests in packages Reviewed-by: vlivanov, dpochepk Contributed-by: igor.ignatyev@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3267
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
     1
/*
3269
86f706946453 6861513: correct copyright attribution in test for 6837094 and 6860469
never
parents: 3267
diff changeset
     2
 * Copyright 2009 Google Inc.  All Rights Reserved.
3267
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
     4
 *
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
     7
 * published by the Free Software Foundation.
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
     8
 *
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    13
 * accompanied this code).
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    14
 *
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3269
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3269
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 3269
diff changeset
    21
 * questions.
3267
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    22
 *
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    23
 */
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    24
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    25
/**
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    26
 * @test
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    27
 * @bug 6860469
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    28
 * @summary remix_address_expressions reshapes address expression with bad control
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    29
 *
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    30
 * @run main/othervm -Xcomp
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    31
 *      -XX:CompileCommand=compileonly,compiler.loopopts.Test6860469::C
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    32
 *      compiler.loopopts.Test6860469
3267
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    33
 */
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    34
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    35
package compiler.loopopts;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    36
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    37
public class Test6860469 {
3267
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    38
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    39
    private static final int H = 16;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    40
    private static final int F = 9;
3267
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    41
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    42
    static int[] fl = new int[1 << F];
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    43
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    44
    static int C(int ll, int f) {
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    45
        int max = -1;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    46
        int min = H + 1;
3267
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    47
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    48
        if (ll != 0) {
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    49
            if (ll < min) {
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    50
                min = ll;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    51
            }
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    52
            if (ll > max) {
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    53
                max = ll;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    54
            }
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    55
        }
3267
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    56
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    57
        if (f > max) {
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    58
            f = max;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    59
        }
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    60
        if (min > f) {
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    61
            min = f;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    62
        }
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    63
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    64
        for (int mc = 1 >> max - f; mc <= 0; mc++) {
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    65
            int i = mc << (32 - f);
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    66
            fl[i] = max;
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    67
        }
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    68
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    69
        return min;
3267
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    70
    }
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    71
40059
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    72
    public static void main(String argv[]) {
c2304140ed64 8132919: Put compiler tests in packages
tpivovarova
parents: 27699
diff changeset
    73
        C(0, 10);
3267
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    74
    }
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    75
}