Make sure only comments are stripped
The regex " +#.*" could also match immediates on ARM, e.g.
cmp r1, #1234
Fix it by requiring a space after the hash mark.
Test: art_compiler_host_tests
Change-Id: I3cf038ff6547edad8a417961d8bb2b27c0872f51
diff --git a/compiler/utils/assembler_test_base.h b/compiler/utils/assembler_test_base.h
index 7331863..bf73808 100644
--- a/compiler/utils/assembler_test_base.h
+++ b/compiler/utils/assembler_test_base.h
@@ -252,7 +252,7 @@
// Remove comments emitted by objdump.
std::string StripComments(const std::string& str) {
- return std::regex_replace(str, std::regex(" +#.*"), "");
+ return std::regex_replace(str, std::regex(" +# .*"), "");
}
std::optional<ScratchDir> scratch_dir_;