test/hotspot/jtreg/compiler/c2/TestUnreachableRegionDuringCCP.java
author iignatyev
Mon, 18 Feb 2019 09:31:07 -0800
changeset 53791 bec6c8739833
parent 51706 be8fe2a352be
permissions -rw-r--r--
8219157: vm/mlvm/mixed/stress/java/findDeadlock should be problem-listed only on mac Reviewed-by: thartmann
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
51706
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
     1
/*
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
     2
 * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
     4
 *
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
     7
 * published by the Free Software Foundation.
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
     8
 *
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    13
 * accompanied this code).
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    14
 *
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    18
 *
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    21
 * questions.
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    22
 */
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    23
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    24
/**
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    25
 * @test
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    26
 * @bug 8210387
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    27
 * @summary Test removal of unreachable regions during CCP.
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    28
 * @library /test/lib
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    29
 * @run main/othervm -Xcomp -XX:-TieredCompilation
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    30
 *                   -XX:CompileOnly=compiler.c2.TestUnreachableRegionDuringCCP::test
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    31
 *                   compiler.c2.TestUnreachableRegionDuringCCP
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    32
 */
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    33
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    34
package compiler.c2;
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    35
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    36
import jdk.test.lib.Asserts;
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    37
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    38
public class TestUnreachableRegionDuringCCP {
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    39
    static int iFld1 = -1;
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    40
    static int iFld2 = -1;
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    41
    static int iArrFld[] = new int[100];
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    42
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    43
    public static void test() {
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    44
        int i = 1;
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    45
        do {
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    46
            iArrFld[i] = iFld1;
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    47
            iFld1 = 42;
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    48
            for (int j = 1; j < 5; j++) {
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    49
                if (i != 0) {
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    50
                    return; // Always returns
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    51
                }
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    52
                iFld2 += j;
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    53
            }
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    54
        } while (++i < 10);
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    55
    }
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    56
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    57
    public static void main(String[] args) {
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    58
        test();
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    59
        Asserts.assertEQ(iFld1, 42);
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    60
        Asserts.assertEQ(iFld2, -1);
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    61
        Asserts.assertEQ(iArrFld[1], -1);
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    62
    }
be8fe2a352be 8210387: C2 compilation fails with "assert(node->_last_del == _last) failed: must have deleted the edge just produced"
thartmann
parents:
diff changeset
    63
}