From 7d181f46ce300bc81b966c4f6e3f4170e998cd77 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Thu, 25 Aug 2016 02:54:04 +0100 Subject: [PATCH] fuzz_arm: Print more than one IR basic block on failure --- tests/arm/fuzz_arm.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/arm/fuzz_arm.cpp b/tests/arm/fuzz_arm.cpp index 7f8a7246..5493b434 100644 --- a/tests/arm/fuzz_arm.cpp +++ b/tests/arm/fuzz_arm.cpp @@ -288,14 +288,17 @@ void FuzzJitArm(const size_t instruction_count, const size_t instructions_to_exe printf("%zu [%x] = %" PRIx64 "\n", record.size, record.address, record.data); } - Dynarmic::Arm::LocationDescriptor descriptor = {0, false, false, 0}; - Dynarmic::IR::Block ir_block = Dynarmic::Arm::Translate(descriptor, &MemoryRead32); - Dynarmic::Optimization::GetSetElimination(ir_block); - Dynarmic::Optimization::DeadCodeElimination(ir_block); - Dynarmic::Optimization::VerificationPass(ir_block); - printf("\n\nIR:\n%s", Dynarmic::IR::DumpBlock(ir_block).c_str()); - - printf("\n\nx86_64:\n%s", jit.Disassemble(descriptor).c_str()); + u32 num_insts = 0; + while (num_insts < instructions_to_execute_count) { + Dynarmic::Arm::LocationDescriptor descriptor = {num_insts * 4, false, false, 0}; + Dynarmic::IR::Block ir_block = Dynarmic::Arm::Translate(descriptor, &MemoryRead32); + Dynarmic::Optimization::GetSetElimination(ir_block); + Dynarmic::Optimization::DeadCodeElimination(ir_block); + Dynarmic::Optimization::VerificationPass(ir_block); + printf("\n\nIR:\n%s", Dynarmic::IR::DumpBlock(ir_block).c_str()); + printf("\n\nx86_64:\n%s", jit.Disassemble(descriptor).c_str()); + num_insts += ir_block.cycle_count; + } #ifdef _MSC_VER __debugbreak();