aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2020-08-09 19:47:08 -0700
committeriximeow <me@iximeow.net>2020-08-09 19:47:08 -0700
commitf523478b3c6f5f29f600368afb1b84c9f5a41eba (patch)
treee34a5234b32600f3bbf31aac908f66bea2e123a5 /test
parent57ff56d8b5c3a3fa4f1d7f4881afbe2ce8e47cfd (diff)
reject instructions made invalid by lock prefixes
Diffstat (limited to 'test')
-rw-r--r--test/long_mode/mod.rs3
-rw-r--r--test/protected_mode/mod.rs3
2 files changed, 6 insertions, 0 deletions
diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs
index 25c8deb..a3ff318 100644
--- a/test/long_mode/mod.rs
+++ b/test/long_mode/mod.rs
@@ -1095,6 +1095,9 @@ fn test_prefixes() {
test_display(&[0x66, 0x41, 0x31, 0xc0], "xor r8w, ax");
test_display(&[0x66, 0x41, 0x32, 0xc0], "xor al, r8b");
test_display(&[0x40, 0x32, 0xc5], "xor al, bpl");
+ test_invalid(&[0xf0, 0x33, 0xc0]);
+ test_display(&[0xf0, 0x31, 0x00], "lock xor [rax], eax");
+ test_invalid(&[0xf0, 0xc7, 0x00, 0x00, 0x00, 0x00]);
}
#[test]
diff --git a/test/protected_mode/mod.rs b/test/protected_mode/mod.rs
index 185e98d..bf9315c 100644
--- a/test/protected_mode/mod.rs
+++ b/test/protected_mode/mod.rs
@@ -970,6 +970,9 @@ fn test_prefixes() {
test_display(&[0x66, 0x31, 0xc0], "xor ax, ax");
test_display(&[0x66, 0x32, 0xc0], "xor al, al");
test_display(&[0x66, 0x32, 0xc5], "xor al, ch");
+ test_invalid(&[0xf0, 0x33, 0xc0]);
+ test_display(&[0xf0, 0x31, 0x00], "lock xor [eax], eax");
+ test_invalid(&[0xf0, 0xc7, 0x00, 0x00, 0x00, 0x00]);
}
#[test]