test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java
author roland
Tue, 12 Mar 2019 15:42:32 +0100
changeset 54119 6bf8877eb1b9
parent 51090 adc4d3fd4095
permissions -rw-r--r--
8220374: C2: LoopStripMining doesn't strip as expected Reviewed-by: rkennke, thartmann, mdoerr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
49475
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
     1
/*
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
     2
 * Copyright (c) 2018, Red Hat, Inc. All rights reserved.
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
     4
 *
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
     7
 * published by the Free Software Foundation.
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
     8
 *
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    13
 * accompanied this code).
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    14
 *
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    18
 *
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    21
 * questions.
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    22
 */
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    23
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    24
/*
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    25
 * @test
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    26
 * @bug 8196294
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    27
 * @summary when loop strip is enabled, LoopStripMiningIterShortLoop should be not null
51090
adc4d3fd4095 8207065: Cleanup compiler tests for Client VM
kvn
parents: 49475
diff changeset
    28
 * @requires vm.flavor == "server"
49475
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    29
 * @library /test/lib /
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    30
 * @modules java.base/jdk.internal.misc
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    31
 *          java.management
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    32
 * @run driver CheckLoopStripMiningIterShortLoop
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    33
 */
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    34
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    35
import jdk.test.lib.process.OutputAnalyzer;
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    36
import jdk.test.lib.process.ProcessTools;
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    37
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    38
public class CheckLoopStripMiningIterShortLoop {
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    39
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    40
    public static void main(String[] args) throws Exception {
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    41
        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-XX:+PrintFlagsFinal", "-version");
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    42
        OutputAnalyzer out = new OutputAnalyzer(pb.start());
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    43
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    44
        long iter = Long.parseLong(out.firstMatch("uintx LoopStripMiningIter                      = (\\d+)", 1));
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    45
        long iterShort = Long.parseLong(out.firstMatch("uintx LoopStripMiningIterShortLoop             = (\\d+)", 1));
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    46
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    47
        if (iter <= 0 || iterShort <= 0) {
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    48
            throw new RuntimeException("Bad defaults for loop strip mining");
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    49
        }
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    50
    }
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    51
}