summaryrefslogtreecommitdiffstats
path: root/compiler/utils
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-01-14 12:03:36 -0800
committerAndreas Gampe <agampe@google.com>2015-01-14 12:03:36 -0800
commit65bec691dfa22d66d5a694c40ec9874581eee333 (patch)
treef46c766f56f897cb3c2a9a3909275725be4af6c2 /compiler/utils
parent4945bfef00ac446d9c5458e55500229d463ab4c3 (diff)
downloadart-65bec691dfa22d66d5a694c40ec9874581eee333.zip
art-65bec691dfa22d66d5a694c40ec9874581eee333.tar.gz
art-65bec691dfa22d66d5a694c40ec9874581eee333.tar.bz2
ART: Clean assembler_test disassemblies
Add a flag. Enable commented-out code. Change-Id: Ife17b72f2b93c128992d757e58b0e51431a3edf8
Diffstat (limited to 'compiler/utils')
-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 2b55120..6f8b301 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;
}