diff options
Diffstat (limited to 'tests/basic.cpp')
-rw-r--r-- | tests/basic.cpp | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/tests/basic.cpp b/tests/basic.cpp index e621faec..344d9d70 100644 --- a/tests/basic.cpp +++ b/tests/basic.cpp @@ -7,14 +7,18 @@ #include <catch2/catch_test_macros.hpp> -#include "oaknut/code_block.hpp" -#include "oaknut/dual_code_block.hpp" +#include "architecture.hpp" #include "oaknut/oaknut.hpp" #include "rand_int.hpp" using namespace oaknut; using namespace oaknut::util; +#ifdef ON_ARM64 + +# include "oaknut/code_block.hpp" +# include "oaknut/dual_code_block.hpp" + TEST_CASE("Basic Test") { CodeBlock mem{4096}; @@ -196,19 +200,6 @@ TEST_CASE("ADR", "[slow]") } } -TEST_CASE("PageOffset (rollover)") -{ - REQUIRE(PageOffset<21, 12>::encode(0x0000000088e74000, 0xffffffffd167dece) == 0xd2202); -} - -TEST_CASE("PageOffset (page boundary)") -{ - REQUIRE(PageOffset<21, 12>::encode(0x0001000000000002, 0x0001000000000001) == 0); - REQUIRE(PageOffset<21, 12>::encode(0x0001000000000001, 0x0001000000000002) == 0); - REQUIRE(PageOffset<21, 12>::encode(0x0001000000001000, 0x0001000000000fff) == 0x1fffff); - REQUIRE(PageOffset<21, 12>::encode(0x0001000000000fff, 0x0001000000001000) == 0x080000); -} - TEST_CASE("ADRP", "[slow]") { CodeBlock mem{4096}; @@ -325,3 +316,18 @@ TEST_CASE("MOVP2R (4GiB boundary)") test(-i); } } + +#endif + +TEST_CASE("PageOffset (rollover)") +{ + REQUIRE(PageOffset<21, 12>::encode(0x0000000088e74000, 0xffffffffd167dece) == 0xd2202); +} + +TEST_CASE("PageOffset (page boundary)") +{ + REQUIRE(PageOffset<21, 12>::encode(0x0001000000000002, 0x0001000000000001) == 0); + REQUIRE(PageOffset<21, 12>::encode(0x0001000000000001, 0x0001000000000002) == 0); + REQUIRE(PageOffset<21, 12>::encode(0x0001000000001000, 0x0001000000000fff) == 0x1fffff); + REQUIRE(PageOffset<21, 12>::encode(0x0001000000000fff, 0x0001000000001000) == 0x080000); +} |