summaryrefslogtreecommitdiff
path: root/compiler/utils/assembler_test.h
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2015-01-14 23:27:23 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-01-14 23:27:23 +0000
commitcbabd3cba33662b296df7c1d392bdd35b3c978ad (patch)
tree3a6ab3abc437d7230fa3af2060282086679dbd7d /compiler/utils/assembler_test.h
parentfe7e224a1f7c2a95ca45246ed54d65f1d3ddf051 (diff)
parent65bec691dfa22d66d5a694c40ec9874581eee333 (diff)
Merge "ART: Clean assembler_test disassemblies"
Diffstat (limited to 'compiler/utils/assembler_test.h')
-rw-r--r--compiler/utils/assembler_test.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/compiler/utils/assembler_test.h b/compiler/utils/assembler_test.h
index 2b5512077e..6f8b3012a4 100644
--- a/compiler/utils/assembler_test.h
+++ b/compiler/utils/assembler_test.h
@@ -29,6 +29,10 @@
namespace art {
+// If you want to take a look at the differences between the ART assembler and GCC, set this flag
+// to true. The disassembled files will then remain in the tmp directory.
+static constexpr bool kKeepDisassembledFiles = false;
+
// Helper for a constexpr string length.
constexpr size_t ConstexprStrLen(char const* str, size_t count = 0) {
return ('\0' == str[0]) ? count : ConstexprStrLen(str+1, count+1);
@@ -685,12 +689,12 @@ class AssemblerTest : public testing::Test {
bool result = CompareFiles(data_name + ".dis", as_name + ".dis");
- // If you want to take a look at the differences between the ART assembler and GCC, comment
- // out the removal code.
-// std::remove(data_name.c_str());
-// std::remove(as_name.c_str());
-// std::remove((data_name + ".dis").c_str());
-// std::remove((as_name + ".dis").c_str());
+ if (!kKeepDisassembledFiles) {
+ std::remove(data_name.c_str());
+ std::remove(as_name.c_str());
+ std::remove((data_name + ".dis").c_str());
+ std::remove((as_name + ".dis").c_str());
+ }
return result;
}