test/hotspot/jtreg/compiler/escapeAnalysis/TestEliminateLocksOffCrash.java
author cgo
Thu, 28 Nov 2019 16:11:44 +0100
changeset 59308 70f49f08c9e6
parent 58372 43c4fb8ba96b
permissions -rw-r--r--
8234894: [TESTBUG] TestEliminateLocksOffCrash fails for client VMs due to Unrecognized VM option EliminateLocks Reviewed-by: thartmann
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
58372
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
     1
/*
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
     2
 * Copyright (c) 2019, Red Hat, Inc. All rights reserved.
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
     4
 *
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
     7
 * published by the Free Software Foundation.
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
     8
 *
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    13
 * accompanied this code).
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    14
 *
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    18
 *
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    21
 * questions.
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    22
 */
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    23
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    24
/*
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    25
 * @test
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    26
 * @bug 8227384
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    27
 * @summary C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
59308
70f49f08c9e6 8234894: [TESTBUG] TestEliminateLocksOffCrash fails for client VMs due to Unrecognized VM option EliminateLocks
cgo
parents: 58372
diff changeset
    28
 * @requires vm.compiler2.enabled & !vm.graal.enabled
58372
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    29
 *
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    30
 * @run main/othervm -XX:-EliminateLocks TestEliminateLocksOffCrash
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    31
 */
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    32
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    33
public class TestEliminateLocksOffCrash {
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    34
    public static void main(String[] args) {
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    35
        for (int i = 0; i < 20_000; i++) {
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    36
            try {
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    37
                test();
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    38
            } catch (Exception e) {
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    39
            }
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    40
        }
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    41
    }
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    42
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    43
    private static void test() throws Exception {
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    44
        Object obj = new Object();
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    45
        synchronized (obj) {
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    46
            throw new Exception();
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    47
        }
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    48
    }
43c4fb8ba96b 8227384: C2 compilation fails with "graph should be schedulable" when running with -XX:-EliminateLocks
roland
parents:
diff changeset
    49
}