diff --git a/tests/A64/fuzz_with_unicorn.cpp b/tests/A64/fuzz_with_unicorn.cpp index 52467fba..f09e8507 100644 --- a/tests/A64/fuzz_with_unicorn.cpp +++ b/tests/A64/fuzz_with_unicorn.cpp @@ -121,7 +121,7 @@ restart: return instruction; } -static void TestInstance(const std::array& regs, const std::vector& instructions) { +static void TestInstance(const std::array& regs, const std::vector& instructions, u32 pstate) { TestEnv jit_env; TestEnv uni_env; @@ -136,11 +136,11 @@ static void TestInstance(const std::array& regs, const std::vector jit.SetRegisters(regs); jit.SetPC(0); jit.SetSP(0x8000000); - jit.SetPstate(0); + jit.SetPstate(pstate); uni.SetRegisters(regs); uni.SetPC(0); uni.SetSP(0x8000000); - uni.SetPstate(0); + uni.SetPstate(pstate); jit_env.ticks_left = instructions.size(); jit.Run(); @@ -160,9 +160,10 @@ TEST_CASE("A64: Single random instruction", "[a64]") { std::generate_n(regs.begin(), 31, []{ return RandInt(0, ~u64(0)); }); std::vector instructions; instructions.push_back(GenRandomInst(0)); + u32 pstate = RandInt(0, 0xF) << 28; printf("%zu: %08x\n", iteration, instructions[0]); - TestInstance(regs, instructions); + TestInstance(regs, instructions, pstate); } -} \ No newline at end of file +}