Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8266181: compiler/eliminateAutobox/TestEliminateBoxInDebugInfo should be in driver mode #3746

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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 {
Expand All @@ -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));
}
}
Expand Down