Lines Matching refs:res
117 NativeAssemblerResult res; in Driver() local
118 Compile(assembly_text, &res, test_name); in Driver()
120 EXPECT_TRUE(res.ok) << res.error_msg; in Driver()
121 if (!res.ok) { in Driver()
126 if (data == *res.code) { in Driver()
127 Clean(&res); in Driver()
129 if (DisassembleBinaries(data, *res.code, test_name)) { in Driver()
130 if (data.size() > res.code->size()) { in Driver()
134 ", gcc size=" << res.code->size(); in Driver()
139 Clean(&res); in Driver()
143 EXPECT_EQ(*res.code, data) << "Outputs (and disassembly) not identical."; in Driver()
379 NativeAssemblerResult* res, in Compile() argument
381 res->ok = false; in Compile()
382 res->code.reset(nullptr); in Compile()
384 res->base_name = GetTmpnam() + std::string("---") + test_name; in Compile()
388 std::ofstream s_out(res->base_name + ".S"); in Compile()
395 if (!Assemble((res->base_name + ".S").c_str(), (res->base_name + ".o").c_str(), in Compile()
396 &res->error_msg)) { in Compile()
397 res->error_msg = "Could not compile."; in Compile()
401 std::string odump = Objdump(res->base_name + ".o"); in Compile()
403 res->error_msg = "Objdump failed."; in Compile()
413 res->error_msg = "Objdump output not recognized: too few tokens."; in Compile()
418 res->error_msg = "Objdump output not recognized: .text not second token."; in Compile()
423 std::istringstream(lengthToken) >> std::hex >> res->length; in Compile()
429 std::ifstream obj(res->base_name + ".o"); in Compile()
431 res->code.reset(new std::vector<uint8_t>(res->length)); in Compile()
432 obj.read(reinterpret_cast<char*>(&(*res->code)[0]), res->length); in Compile()
435 res->ok = true; in Compile()
440 void Clean(const NativeAssemblerResult* res) { in Clean() argument
441 std::remove((res->base_name + ".S").c_str()); in Clean()
442 std::remove((res->base_name + ".o").c_str()); in Clean()
443 std::remove((res->base_name + ".o.dump").c_str()); in Clean()