Path: blob/master/test/hotspot/jtreg/compiler/compilercontrol/commands/OptionTest.java
41153 views
/*1* Copyright Amazon.com Inc. 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*/2223/*24* @test25* @bug 825780026* @summary Tests CompileCommand=option,package/class,ccstrlist,ControlIntrinsic,+_id27* @library /test/lib /28*29* @run driver compiler.compilercontrol.commands.OptionTest30*/3132package compiler.compilercontrol.commands;3334import jdk.test.lib.process.ProcessTools;3536public class OptionTest {37public static void main(String[] args) throws Exception {38ProcessTools.executeTestJvm("-XX:CompileCommand=option,package/class,ccstrlist,ControlIntrinsic,+_id", "-version")39.shouldHaveExitValue(0)40.shouldContain("CompileCommand: An error occurred during parsing")41.shouldContain("Error: Did not specify any method name")42.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");4344ProcessTools.executeTestJvm("-XX:CompileCommand=option,*,ccstrlist,ControlIntrinsic,+_id", "-version")45.shouldHaveExitValue(0)46.shouldContain("CompileCommand: An error occurred during parsing")47.shouldContain("Error: Did not specify any method name")48.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");4950// corner case:51// ccstrlist could be a valid method name, so it is accepted in the well-formed case.52ProcessTools.executeTestJvm("-XX:CompileCommand=option,*.ccstrlist,ccstrlist,ControlIntrinsic,+_id", "-version")53.shouldContain("CompileCommand: ControlIntrinsic *.ccstrlist const char* ControlIntrinsic")54.shouldHaveExitValue(0)55.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");5657ProcessTools.executeTestJvm("-XX:CompileCommand=option,*.*,ccstrlist,ControlIntrinsic,+_id", "-version")58.shouldContain("CompileCommand: ControlIntrinsic *.* const char* ControlIntrinsic")59.shouldHaveExitValue(0)60.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");6162ProcessTools.executeTestJvm("-XX:CompileCommand=option,class,PrintIntrinsics", "-version")63.shouldHaveExitValue(0)64.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");6566// corner case:67// PrintIntrinsics could be a valid method name, so it is accepted in the well-formed case.68ProcessTools.executeTestJvm("-XX:CompileCommand=option,class.PrintIntrinsics,PrintIntrinsics", "-version")69.shouldContain("CompileCommand: PrintIntrinsics class.PrintIntrinsics bool PrintIntrinsics = true")70.shouldHaveExitValue(0)71.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");7273// corner case:74// _dontinline_* is a valid method pattern, so it should be accepted75ProcessTools.executeTestJvm("-XX:CompileCommand=dontinline,*::dontinline_*", "-version")76.shouldContain("CompileCommand: dontinline *.dontinline_* bool dontinline = true")77.shouldHaveExitValue(0)78.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");7980ProcessTools.executeTestJvm("-XX:CompileCommand=dontinline,*.dontinline", "-version")81.shouldContain("CompileCommand: dontinline *.dontinline bool dontinline = true")82.shouldHaveExitValue(0)83.shouldNotContain("Error: Did not specify any method name")84.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");85}86}878889