aboutsummaryrefslogtreecommitdiff
path: root/test/long_mode
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2024-06-23 15:15:50 -0700
committeriximeow <me@iximeow.net>2024-06-23 15:15:50 -0700
commit2002347272391dc6a70d83fe8293f2ce35ed26ee (patch)
tree2afdfc0e24a07237752377f2cd30d243c465488b /test/long_mode
parent2ac46a98585b93f62961fdd82a1f2d1266761305 (diff)
add additional `call` test cases
fix 32-bit 66-prefixed ff /2 call not having 16-bit operands fix momentary regression in rendering `call` instructions to string
Diffstat (limited to 'test/long_mode')
-rw-r--r--test/long_mode/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs
index d8cb0ef..917d16a 100644
--- a/test/long_mode/mod.rs
+++ b/test/long_mode/mod.rs
@@ -1303,14 +1303,25 @@ fn test_control_flow() {
test_display(&[0x73, 0x31], "jnb $+0x31");
test_display(&[0x72, 0x5a], "jb $+0x5a");
test_display(&[0x72, 0xf0], "jb $-0x10");
+ test_display(&[0xe8, 0x01, 0x00, 0x00, 0x00], "call $+0x1");
+ test_display(&[0xe8, 0x80, 0x00, 0x00, 0x00], "call $+0x80");
+ test_display(&[0xe8, 0xff, 0xff, 0xff, 0xff], "call $-0x1");
+ test_display(&[0xe9, 0x01, 0x00, 0x00, 0x00], "jmp $+0x1");
+ test_display(&[0xe9, 0x80, 0x00, 0x00, 0x00], "jmp $+0x80");
+ test_display(&[0xe9, 0xff, 0xff, 0xff, 0xff], "jmp $-0x1");
test_display(&[0x0f, 0x86, 0x8b, 0x01, 0x00, 0x00], "jna $+0x18b");
test_display(&[0x0f, 0x85, 0x3b, 0x25, 0x00, 0x00], "jnz $+0x253b");
test_display(&[0x74, 0x47], "jz $+0x47");
test_display(&[0xff, 0x15, 0x7e, 0x72, 0x24, 0x00], "call qword [rip + 0x24727e]");
+ test_display(&[0xff, 0x15, 0x7e, 0x72, 0x24, 0x00], "call qword [rip + 0x24727e]");
test_display(&[0xff, 0x24, 0xcd, 0x70, 0xa0, 0xbc, 0x01], "jmp qword [rcx * 8 + 0x1bca070]");
+ test_display(&[0xff, 0x14, 0xcd, 0x70, 0xa0, 0xbc, 0x01], "call qword [rcx * 8 + 0x1bca070]");
test_display(&[0xff, 0xe0], "jmp rax");
+ test_display(&[0xff, 0xd0], "call rax");
test_display(&[0x66, 0xff, 0xe0], "jmp rax");
test_display(&[0x67, 0xff, 0xe0], "jmp rax");
+ test_display(&[0x66, 0xff, 0xd0], "call rax");
+ test_display(&[0x67, 0xff, 0xd0], "call rax");
test_invalid(&[0xff, 0xd8]);
test_display(&[0xff, 0x18], "callf mword [rax]");
test_display(&[0xe0, 0x12], "loopnz $+0x12");