test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java
author roland
Wed, 21 Mar 2018 10:05:36 +0100
changeset 49475 8f3c8e44e585
child 51090 adc4d3fd4095
permissions -rw-r--r--
8196294: LoopStripMiningIterShortLoop is set to zero by default Reviewed-by: shade, thartmann, kvn
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
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    28
 * @library /test/lib /
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    29
 * @modules java.base/jdk.internal.misc
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    30
 *          java.management
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    31
 * @run driver CheckLoopStripMiningIterShortLoop
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    32
 */
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
import jdk.test.lib.process.OutputAnalyzer;
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    35
import jdk.test.lib.process.ProcessTools;
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    36
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    37
public class CheckLoopStripMiningIterShortLoop {
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    38
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    39
    public static void main(String[] args) throws Exception {
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    40
        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-XX:+PrintFlagsFinal", "-version");
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    41
        OutputAnalyzer out = new OutputAnalyzer(pb.start());
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    42
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    43
        long iter = Long.parseLong(out.firstMatch("uintx LoopStripMiningIter                      = (\\d+)", 1));
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    44
        long iterShort = Long.parseLong(out.firstMatch("uintx LoopStripMiningIterShortLoop             = (\\d+)", 1));
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    45
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    46
        if (iter <= 0 || iterShort <= 0) {
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    47
            throw new RuntimeException("Bad defaults for loop strip mining");
8f3c8e44e585 8196294: LoopStripMiningIterShortLoop is set to zero by default
roland
parents:
diff changeset
    48
        }
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
}