diff options
Diffstat (limited to 'compiler/utils/assembler_thumb_test.cc')
| -rw-r--r-- | compiler/utils/assembler_thumb_test.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/utils/assembler_thumb_test.cc b/compiler/utils/assembler_thumb_test.cc index 772fa9aa4b..773862710d 100644 --- a/compiler/utils/assembler_thumb_test.cc +++ b/compiler/utils/assembler_thumb_test.cc @@ -15,9 +15,11 @@ */ #include <dirent.h> +#include <errno.h> #include <fstream> -#include <sys/types.h> #include <map> +#include <string.h> +#include <sys/types.h> #include "gtest/gtest.h" #include "utils/arm/assembler_thumb2.h" @@ -105,12 +107,14 @@ void dump(std::vector<uint8_t>& code, const char* testname) { // Assemble the .S snprintf(cmd, sizeof(cmd), "%sas %s -o %s.o", toolsdir.c_str(), filename, filename); - system(cmd); + int cmd_result = system(cmd); + ASSERT_EQ(cmd_result, 0) << strerror(errno); // Remove the $d symbols to prevent the disassembler dumping the instructions // as .word snprintf(cmd, sizeof(cmd), "%sobjcopy -N '$d' %s.o %s.oo", toolsdir.c_str(), filename, filename); - system(cmd); + int cmd_result2 = system(cmd); + ASSERT_EQ(cmd_result2, 0) << strerror(errno); // Disassemble. @@ -119,7 +123,8 @@ void dump(std::vector<uint8_t>& code, const char* testname) { if (kPrintResults) { // Print the results only, don't check. This is used to generate new output for inserting // into the .inc file. - system(cmd); + int cmd_result3 = system(cmd); + ASSERT_EQ(cmd_result3, 0) << strerror(errno); } else { // Check the results match the appropriate results in the .inc file. FILE *fp = popen(cmd, "r"); |