From 65bec691dfa22d66d5a694c40ec9874581eee333 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 14 Jan 2015 12:03:36 -0800 Subject: ART: Clean assembler_test disassemblies Add a flag. Enable commented-out code. Change-Id: Ife17b72f2b93c128992d757e58b0e51431a3edf8 --- compiler/utils/assembler_test.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'compiler/utils/assembler_test.h') 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; } -- cgit v1.2.3-59-g8ed1b