aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2023-12-16 16:12:25 -0800
committeriximeow <me@iximeow.net>2023-12-16 16:12:25 -0800
commit58913fc4e1bb153fe9d8735164ef922f71c2fa97 (patch)
tree6106f045b08b6c48cc47ca7ac41f9997fec2ad91 /test
parent83b12fc09a69cc5324f6f002b8c52382d4b236d1 (diff)
fix hreset being disassembled as having second operand of "Nothing"
just report it having one operand...
Diffstat (limited to 'test')
-rw-r--r--test/long_mode/mod.rs3
-rw-r--r--test/protected_mode/mod.rs3
-rw-r--r--test/real_mode/mod.rs9
3 files changed, 15 insertions, 0 deletions
diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs
index c0ec1a5..8cb032c 100644
--- a/test/long_mode/mod.rs
+++ b/test/long_mode/mod.rs
@@ -3463,6 +3463,9 @@ fn test_keylocker() {
#[test]
fn from_llvm() {
test_display(&[0xf3, 0x0f, 0x3a, 0xf0, 0xc0, 0x01], "hreset 0x1");
+ let mut reader = yaxpeax_arch::U8Reader::new(&[0xf3, 0x0f, 0x3a, 0xf0, 0xc0, 0x01]);
+ let hreset = InstDecoder::default().decode(&mut reader).expect("can disassemble test instruction");
+ assert_eq!(hreset.operand_count(), 1);
}
#[test]
diff --git a/test/protected_mode/mod.rs b/test/protected_mode/mod.rs
index fd77b5e..0f3a6ff 100644
--- a/test/protected_mode/mod.rs
+++ b/test/protected_mode/mod.rs
@@ -3138,6 +3138,9 @@ fn test_keylocker() {
#[test]
fn from_llvm() {
test_display(&[0xf3, 0x0f, 0x3a, 0xf0, 0xc0, 0x01], "hreset 0x1");
+ let mut reader = yaxpeax_arch::U8Reader::new(&[0xf3, 0x0f, 0x3a, 0xf0, 0xc0, 0x01]);
+ let hreset = InstDecoder::default().decode(&mut reader).expect("can disassemble test instruction");
+ assert_eq!(hreset.operand_count(), 1);
}
#[test]
diff --git a/test/real_mode/mod.rs b/test/real_mode/mod.rs
index bc045d8..c5b1548 100644
--- a/test/real_mode/mod.rs
+++ b/test/real_mode/mod.rs
@@ -18414,6 +18414,15 @@ fn test_invalid_sequences() {
}
+// some test cases are best just lifted from llvm or gcc.
+#[test]
+fn from_llvm() {
+ test_display(&[0xf3, 0x0f, 0x3a, 0xf0, 0xc0, 0x01], "hreset 0x1");
+ let mut reader = yaxpeax_arch::U8Reader::new(&[0xf3, 0x0f, 0x3a, 0xf0, 0xc0, 0x01]);
+ let hreset = InstDecoder::default().decode(&mut reader).expect("can disassemble test instruction");
+ assert_eq!(hreset.operand_count(), 1);
+}
+
#[test]
fn from_reports() {
// negative compressed evex displacements should not overflow and panic