Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8258682: compiler/intrinsics/mathexact/sanity tests fail with RepeatC…
…ompilation

Normalize match and suspect counts in the verify() method by the number of
compilation repetitions, if the RepeatCompilation option is used.

Reviewed-by: kvn, chagedorn
  • Loading branch information
robcasloz authored and chhagedorn committed Dec 22, 2020
1 parent 1594372 commit 3df6ec2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/hotspot/jtreg/compiler/testlibrary/intrinsics/Verifier.java
Expand Up @@ -26,6 +26,8 @@
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Verifier {
enum VerificationStrategy {
Expand Down Expand Up @@ -120,10 +122,18 @@ private static void verify(String hsLogFile) throws Exception {
String prefix = "<intrinsic id='";
String prefixWithId = prefix + intrinsicId + "'";

int repeatCnt = 1;
Pattern repeatComp = Pattern.compile("-XX:RepeatCompilation=(\\d+)*");
try (BufferedReader compLogReader
= new BufferedReader(new FileReader(hsLogFile))) {
String logLine;
while ((logLine = compLogReader.readLine()) != null) {
// Check if compilations are repeated. If so, normalize the
// match and suspect counts.
Matcher m = repeatComp.matcher(logLine);
if (m.find()) {
repeatCnt = Integer.parseInt(m.group(1)) + 1;
}
if (logLine.startsWith(prefix)) {
if (logLine.startsWith(prefixWithId)) {
fullMatchCnt++;
Expand All @@ -135,6 +145,8 @@ private static void verify(String hsLogFile) throws Exception {
}
}
}
fullMatchCnt /= repeatCnt;
suspectCnt /= repeatCnt;

VerificationStrategy strategy = VerificationStrategy.valueOf(
System.getProperty("verificationStrategy",
Expand Down

1 comment on commit 3df6ec2

@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.