Skip to content

Commit

Permalink
8266165: TestNoWarningLoopStripMiningIterSet is runnable only on VM w…
Browse files Browse the repository at this point in the history
…/ G1, Shenandoah, Z and Epsilon

Reviewed-by: roland
  • Loading branch information
iignatev committed Apr 28, 2021
1 parent 8954bef commit c71c268
Showing 1 changed file with 42 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,50 @@
*/

/*
* @test
* @test id=G1
* @bug 8241486
* @summary G1/Z give warning when using LoopStripMiningIter and turn off LoopStripMiningIter (0)
* @requires vm.flagless
* @requires vm.flavor == "server" & !vm.graal.enabled
* @requires vm.gc.G1 & vm.gc.Shenandoah & vm.gc.Z & vm.gc.Epsilon
* @requires vm.gc.G1
* @library /test/lib
* @run driver TestNoWarningLoopStripMiningIterSet
* @run driver TestNoWarningLoopStripMiningIterSet G1
*/

/*
* @test id=Shenandoah
* @bug 8241486
* @summary G1/Z give warning when using LoopStripMiningIter and turn off LoopStripMiningIter (0)
* @requires vm.flagless
* @requires vm.flavor == "server" & !vm.graal.enabled
* @requires vm.gc.Shenandoah
* @library /test/lib
* @run driver TestNoWarningLoopStripMiningIterSet Shenandoah
*/

/*
* @test id=Z
* @bug 8241486
* @summary G1/Z give warning when using LoopStripMiningIter and turn off LoopStripMiningIter (0)
* @requires vm.flagless
* @requires vm.flavor == "server" & !vm.graal.enabled
* @requires vm.gc.Z
* @library /test/lib
* @run driver TestNoWarningLoopStripMiningIterSet Z
*/

/*
* @test id=Epsilon
* @bug 8241486
* @summary G1/Z give warning when using LoopStripMiningIter and turn off LoopStripMiningIter (0)
* @requires vm.flagless
* @requires vm.flavor == "server" & !vm.graal.enabled
* @requires vm.gc.Epsilon
* @library /test/lib
* @run driver TestNoWarningLoopStripMiningIterSet Epsilon
*/


import jdk.test.lib.Asserts;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.process.OutputAnalyzer;
Expand Down Expand Up @@ -60,11 +94,10 @@ public static void testWith(Consumer<OutputAnalyzer> check, String msg, boolean
}

public static void main(String[] args) throws Exception {
for (String gc : List.of("-XX:+UseG1GC", "-XX:+UseZGC", "-XX:+UseShenandoahGC", "-XX:+UseEpsilonGC")) {
testWith(output -> output.shouldNotContain(CLSOffLSMGreaterZero), "should have CLS and LSM enabled", true, 100, "-XX:LoopStripMiningIter=100", gc);
testWith(output -> output.shouldContain(CLSOffLSMGreaterZero), "should have CLS and LSM disabled", false, 0, "-XX:-UseCountedLoopSafepoints", "-XX:LoopStripMiningIter=100", gc);
testWith(output -> output.shouldContain(CLSOnLSMEqualZero), "should have CLS and LSM enabled", true, 1, "-XX:LoopStripMiningIter=0", gc);
testWith(output -> output.shouldNotContain(CLSOnLSMEqualZero), "should have CLS and LSM disabled", false, 0, "-XX:-UseCountedLoopSafepoints", "-XX:LoopStripMiningIter=0", gc);
}
String gc = "-XX:+Use" + args[0] + "GC";
testWith(output -> output.shouldNotContain(CLSOffLSMGreaterZero), "should have CLS and LSM enabled", true, 100, "-XX:LoopStripMiningIter=100", gc);
testWith(output -> output.shouldContain(CLSOffLSMGreaterZero), "should have CLS and LSM disabled", false, 0, "-XX:-UseCountedLoopSafepoints", "-XX:LoopStripMiningIter=100", gc);
testWith(output -> output.shouldContain(CLSOnLSMEqualZero), "should have CLS and LSM enabled", true, 1, "-XX:LoopStripMiningIter=0", gc);
testWith(output -> output.shouldNotContain(CLSOnLSMEqualZero), "should have CLS and LSM disabled", false, 0, "-XX:-UseCountedLoopSafepoints", "-XX:LoopStripMiningIter=0", gc);
}
}

1 comment on commit c71c268

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.