diff --git a/Source/UnitTests/Core/PowerPC/JitArm64/MovI2R.cpp b/Source/UnitTests/Core/PowerPC/JitArm64/MovI2R.cpp index 8f44259f8d..c21e47c03d 100644 --- a/Source/UnitTests/Core/PowerPC/JitArm64/MovI2R.cpp +++ b/Source/UnitTests/Core/PowerPC/JitArm64/MovI2R.cpp @@ -78,20 +78,44 @@ TEST(JitArm64, MovI2R_ADP) { TestMovI2R test; const u64 base = Common::BitCast(test.GetCodePtr()); + + // Test offsets around 0 for (s64 i = -0x20000; i < 0x20000; i++) { const u64 offset = static_cast(i); test.Check64(base + offset); } + + // Test offsets around the maximum + for (const s64 i : {-0x200000ll, 0x200000ll}) + { + for (s64 j = -4; j < 4; j++) + { + const u64 offset = static_cast(i + j); + test.Check64(base + offset); + } + } } TEST(JitArm64, MovI2R_ADRP) { TestMovI2R test; const u64 base = Common::BitCast(test.GetCodePtr()) & ~0xFFF; + + // Test offsets around 0 for (s64 i = -0x20000; i < 0x20000; i++) { const u64 offset = static_cast(i) << 12; test.Check64(base + offset); } + + // Test offsets around the maximum + for (const s64 i : {-0x100000000ll, -0x80000000ll, 0x80000000ll, 0x100000000ll}) + { + for (s64 j = -4; j < 4; j++) + { + const u64 offset = static_cast(i + (j << 12)); + test.Check64(base + offset); + } + } } diff --git a/Source/UnitTests/UnitTests.vcxproj b/Source/UnitTests/UnitTests.vcxproj index f758af5bed..230ac50412 100644 --- a/Source/UnitTests/UnitTests.vcxproj +++ b/Source/UnitTests/UnitTests.vcxproj @@ -78,6 +78,9 @@ + + +