hotspot/test/compiler/6860469/Test.java
author trims
Thu, 27 May 2010 19:08:38 -0700
changeset 5547 f4b087cbb361
parent 3269 86f706946453
permissions -rw-r--r--
6941466: Oracle rebranding changes for Hotspot repositories Summary: Change all the Sun copyrights to Oracle copyright Reviewed-by: ohair
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
 *
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    30
 * @run main/othervm -Xcomp -XX:CompileOnly=Test.C Test
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    31
 */
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    32
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    33
public class Test {
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    34
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    35
  private static final int H = 16;
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    36
  private static final int F = 9;
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    37
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    38
  static int[] fl = new int[1 << F];
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    39
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    40
  static int C(int ll, int f) {
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    41
    int max = -1;
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    42
    int min = H + 1;
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    43
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    44
    if (ll != 0) {
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    45
      if (ll < min) {
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    46
        min = ll;
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    47
      }
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    48
      if (ll > max) {
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    49
        max = ll;
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    50
      }
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    51
    }
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    52
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    53
    if (f > max) {
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    54
      f = max;
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    55
    }
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    56
    if (min > f) {
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    57
      min = f;
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    58
    }
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    59
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    60
    for (int mc = 1 >> max - f; mc <= 0; mc++) {
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    61
      int i = mc << (32 - f);
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    62
      fl[i] = max;
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    63
    }
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    64
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    65
    return min;
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    66
  }
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    67
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    68
  public static void main(String argv[]) {
519fbe71f995 6860469: remix_address_expressions sets incorrect control causing crash in split_if_with_block_post
never
parents:
diff changeset
    69
    C(0, 10);
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
}