diff options
| author | JMC47 <JMC4789@gmail.com> | 2025-10-09 14:07:13 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-09 14:07:13 -0400 |
| commit | d8bcd6d82ee2359bf3381770d55e0580afc2b388 (patch) | |
| tree | 732bca57f23155d3f1caacb94adbeb14eb4f1976 /Source/UnitTests | |
| parent | f43b78efb69059866817db7aff6d2bc4f17ac65a (diff) | |
| parent | f6e5448b43f74fffab22eca2f96b281ef0f662d3 (diff) | |
Merge pull request #13996 from SuperSamus/jit64-dynamic-known-jmp-len
Jit64: Dynamic length of regular jump instruction (for known addresses)
Diffstat (limited to 'Source/UnitTests')
| -rw-r--r-- | Source/UnitTests/Common/x64EmitterTest.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/UnitTests/Common/x64EmitterTest.cpp b/Source/UnitTests/Common/x64EmitterTest.cpp index ae69c3f712..f38bb7c1b9 100644 --- a/Source/UnitTests/Common/x64EmitterTest.cpp +++ b/Source/UnitTests/Common/x64EmitterTest.cpp @@ -298,12 +298,14 @@ TEST_F(x64EmitterTest, POP_Register) TEST_F(x64EmitterTest, JMP) { emitter->NOP(1); - emitter->JMP(code_buffer, XEmitter::Jump::Short); + emitter->JMP(code_buffer); ExpectBytes({/* nop */ 0x90, /* short jmp */ 0xeb, /* offset -3 */ 0xfd}); - emitter->NOP(1); - emitter->JMP(code_buffer, XEmitter::Jump::Near); - ExpectBytes({/* nop */ 0x90, /* near jmp */ 0xe9, /* offset -6 */ 0xfa, 0xff, 0xff, 0xff}); + emitter->NOP(0x90); + const u8* after_nops = emitter->GetCodePtr(); + ResetCodeBuffer(); + emitter->JMP(after_nops); + ExpectBytes({/* near jmp */ 0xe9, /* offset */ 0x8B, 0, 0, 0}); } TEST_F(x64EmitterTest, JMPptr_Register) |
