Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8274039: codestrings gtest fails when hsdis is present
Reviewed-by: shade
  • Loading branch information
Patric Hedlin committed Sep 22, 2021
1 parent 33df388 commit c9de806
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/hotspot/gtest/code/test_codestrings.cpp
Expand Up @@ -37,10 +37,13 @@ static const char* replace_addr_expr(const char* str)
{
// Remove any address expression "0x0123456789abcdef" found in order to
// aid string comparison. Also remove any trailing printout from a padded
// buffer.
// buffer (too brittle?).

std::basic_string<char> tmp = std::regex_replace(str, std::regex("0x[0-9a-fA-F]+"), "<addr>");
std::basic_string<char> red = std::regex_replace(tmp, std::regex("\\s+<addr>:\\s+\\.inst\\t<addr> ; undefined"), "");
std::basic_string<char> tmp1 = std::regex_replace(str, std::regex("0x[0-9a-fA-F]+"), "<addr>");
// Padding: aarch64
std::basic_string<char> tmp2 = std::regex_replace(tmp1, std::regex("\\s+<addr>:\\s+\\.inst\\t<addr> ; undefined"), "");
// Padding: x64
std::basic_string<char> red = std::regex_replace(tmp2, std::regex("\\s+<addr>:\\s+hlt[ \\t]+(?!\\n\\s+;;)"), "");

return os::strdup(red.c_str());
}
Expand Down

1 comment on commit c9de806

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