misaligned_page_table.cpp 857 B

123456789101112131415161718192021222324252627282930
  1. /* This file is part of the dynarmic project.
  2. * Copyright (c) 2018 MerryMage
  3. * SPDX-License-Identifier: 0BSD
  4. */
  5. #include <catch2/catch_test_macros.hpp>
  6. #include "./testenv.h"
  7. #include "dynarmic/interface/A64/a64.h"
  8. TEST_CASE("misaligned load/store do not use page_table when detect_misaligned_access_via_page_table is set", "[a64]") {
  9. A64TestEnv env;
  10. Dynarmic::A64::UserConfig conf{&env};
  11. conf.page_table = nullptr;
  12. conf.detect_misaligned_access_via_page_table = 128;
  13. conf.only_detect_misalignment_via_page_table_on_page_boundary = true;
  14. Dynarmic::A64::Jit jit{conf};
  15. env.code_mem.emplace_back(0x3c800400); // STR Q0, [X0], #0
  16. env.code_mem.emplace_back(0x14000000); // B .
  17. jit.SetPC(0);
  18. jit.SetRegister(0, 0x000000000b0afff8);
  19. env.ticks_left = 2;
  20. jit.Run();
  21. // If we don't crash we're fine.
  22. }