Skip to content
Permalink
Browse files
8266181: compiler/eliminateAutobox/TestEliminateBoxInDebugInfo should…
… be in driver mode

Reviewed-by: kvn
  • Loading branch information
iignatev committed Apr 28, 2021
1 parent 81b1502 commit 6b5e5d7a2c01d6f2b28d54033a2fd37add469d36
Showing with 6 additions and 17 deletions.
  1. +6 −17 test/hotspot/jtreg/compiler/eliminateAutobox/TestEliminateBoxInDebugInfo.java
@@ -28,37 +28,26 @@
* @summary Verify that box object is scalarized in case it is directly referenced by debug info.
* @library /test/lib
*
* @run main/othervm compiler.c2.TestEliminateBoxInDebugInfo
* @run driver compiler.c2.TestEliminateBoxInDebugInfo
*/
package compiler.c2;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import jdk.test.lib.Platform;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;

import jdk.test.lib.Asserts;

public class TestEliminateBoxInDebugInfo {
public static void runTest() throws Exception {
final String[] arguments = {
String[] arguments = {
"-XX:CompileCommand=compileonly,compiler/c2/TestEliminateBoxInDebugInfo$Test.foo",
"-XX:CompileCommand=dontinline,compiler/c2/TestEliminateBoxInDebugInfo$Test.black",
"-Xbatch",
"-XX:+PrintEliminateAllocations",
Test.class.getName()
};
};
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(arguments);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
System.out.println(output.getStdout());
String pattern = ".*Eliminated.*";
Pattern r = Pattern.compile(pattern);
Matcher m = r.matcher(output.getStdout());
if (!m.find()) {
throw new RuntimeException("Could not find Elimination output");
}
output.shouldHaveExitValue(0)
.stdoutShouldContain("++++ Eliminated: ");
}

public static void main(String[] args) throws Exception {
@@ -68,7 +57,7 @@ public static void main(String[] args) throws Exception {
static class Test {
public static void main(String[] args) throws Exception {
// warmup
for(int i = 0; i < 100000; i++) {
for (int i = 0; i < 100000; i++) {
foo(1000 + (i % 1000));
}
}

1 comment on commit 6b5e5d7

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 6b5e5d7 Apr 28, 2021

Please sign in to comment.