Exercise the generation of SBFX on ARM32 & Thumb-2.
Exercise the generation of the ARM SBFX intruction in
compiler/utils/arm/assembler_arm32_test.cc (ARM
instruction set encoding) and in
compiler/utils/arm/assembler_thumb2_test.cc (Thumb
instruction set encoding).
Change-Id: Ic72683aac6dd6628e227523e352c395e1a63b52e
diff --git a/compiler/utils/assembler_test.h b/compiler/utils/assembler_test.h
index 91237ae..0378176 100644
--- a/compiler/utils/assembler_test.h
+++ b/compiler/utils/assembler_test.h
@@ -394,10 +394,19 @@
std::vector<std::string> args;
+ // Encaspulate the whole command line in a single string passed to
+ // the shell, so that GetAssemblerCommand() may contain arguments
+ // in addition to the program name.
args.push_back(GetAssemblerCommand());
args.push_back("-o");
args.push_back(to_file);
args.push_back(from_file);
+ std::string cmd = Join(args, ' ');
+
+ args.clear();
+ args.push_back("/bin/sh");
+ args.push_back("-c");
+ args.push_back(cmd);
return Exec(args, error_msg);
}
@@ -414,6 +423,9 @@
std::string error_msg;
std::vector<std::string> args;
+ // Encaspulate the whole command line in a single string passed to
+ // the shell, so that GetObjdumpCommand() may contain arguments
+ // in addition to the program name.
args.push_back(GetObjdumpCommand());
args.push_back(file);
args.push_back(">");
@@ -490,6 +502,9 @@
bool DisassembleBinary(std::string file, std::string* error_msg) {
std::vector<std::string> args;
+ // Encaspulate the whole command line in a single string passed to
+ // the shell, so that GetDisassembleCommand() may contain arguments
+ // in addition to the program name.
args.push_back(GetDisassembleCommand());
args.push_back(file);
args.push_back("| sed -n \'/<.data>/,$p\' | sed -e \'s/.*://\'");