Path: blob/master/test/hotspot/jtreg/compiler/arguments/BMICommandLineOptionTestBase.java
41149 views
/*1* Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package compiler.arguments;2425import jdk.test.lib.cli.CPUSpecificCommandLineOptionTest;26import jdk.test.lib.cli.CommandLineOptionTest;2728/**29* Base class for all X86 bit manipulation related command line options.30*31* Note that this test intended to verify that VM could be launched with32* specific options and that values of these options processed correctly.33* In order to do that test launch a new VM with tested options, the same34* flavor-specific flag as one that was used for parent VM (-client, -server,35* -minimal, -graal) and '-version'.36*/37public abstract class BMICommandLineOptionTestBase38extends CPUSpecificCommandLineOptionTest {3940public static final String LZCNT_WARNING =41"lzcnt instruction is not available on this CPU";42public static final String TZCNT_WARNING =43"tzcnt instruction is not available on this CPU";44public static final String BMI1_WARNING =45"BMI1 instructions are not available on this CPU";4647protected final String optionName;48protected final String warningMessage;49protected final String errorMessage;5051/**52* Construct new test on {@code optionName} option.53*54* @param optionName Name of the option to be tested55* without -XX:[+-] prefix.56* @param warningMessage Message that can occur in VM output57* if CPU on test box does not support58* features required by the option.59* @param supportedCPUFeatures CPU features requires by the option,60* that should be supported on test box.61* @param unsupportedCPUFeatures CPU features requires by the option,62* that should not be supported on test box.63*/64public BMICommandLineOptionTestBase(String optionName,65String warningMessage,66String supportedCPUFeatures[],67String unsupportedCPUFeatures[]) {68super(".*", supportedCPUFeatures, unsupportedCPUFeatures);69this.optionName = optionName;70this.warningMessage = warningMessage;71this.errorMessage = String.format(72CommandLineOptionTest.UNRECOGNIZED_OPTION_ERROR_FORMAT,73optionName);74}7576}77787980