Skip to content

Commit

Permalink
Add basic sanity test for stress IGVN options
Browse files Browse the repository at this point in the history
  • Loading branch information
robcasloz committed Sep 23, 2020
1 parent 6afe2a9 commit 829b1a1
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 6 deletions.
45 changes: 45 additions & 0 deletions test/hotspot/jtreg/compiler/arguments/TestStressIGVNOptions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/

/*
* @test
* @bug 8252219
* @summary Tests that different combinations of the options -XX:+StressIGVN,
* -XX:StressSeed=N, and -XX:+GenerateStressSeed are accepted.
* @run main/othervm -XX:+StressIGVN
* compiler.arguments.TestStressIGVNOptions
* @run main/othervm -XX:+StressIGVN -XX:StressSeed=42
* compiler.arguments.TestStressIGVNOptions
* @run main/othervm -XX:+StressIGVN -XX:+GenerateStressSeed
* compiler.arguments.TestStressIGVNOptions
*/

package compiler.arguments;

public class TestStressIGVNOptions {

static public void main(String[] args) {
System.out.println("Passed");
}
}

4 changes: 2 additions & 2 deletions test/hotspot/jtreg/compiler/debug/TestGenerateStressSeed.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
* @test
* @bug 8252219
* @requires vm.compiler2.enabled
* @summary Tests that -XX:+GenerateStressSeed is accepted, and that, in
* combination with -XX:+StressIGVN, C2 generates and logs a seed.
* @summary Tests that -XX:+GenerateStressSeed, in combination with
* -XX:+StressIGVN, generates and logs a seed.
* @library /test/lib /
* @run driver compiler.debug.TestGenerateStressSeed
*/
Expand Down
7 changes: 3 additions & 4 deletions test/hotspot/jtreg/compiler/debug/TestStressIGVN.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@
* @test
* @bug 8252219
* @requires vm.compiler2.enabled
* @summary Tests that:
* 1) the options -XX:+StressIGVN and -XX:StressSeed=N are accepted,
* 2) compilations with the same seed yield the same IGVN trace, and
* 3) compilations with different seeds yield different IGVN traces.
* @summary Tests that compilations with the same seed yield the same IGVN
* trace, and compilations with different seeds yield different IGVN
* traces.
* @library /test/lib /
* @run driver compiler.debug.TestStressIGVN
*/
Expand Down

0 comments on commit 829b1a1

Please sign in to comment.