diff options
Diffstat (limited to 'test/long_mode/operand.rs')
-rw-r--r-- | test/long_mode/operand.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/long_mode/operand.rs b/test/long_mode/operand.rs new file mode 100644 index 0000000..885c6d1 --- /dev/null +++ b/test/long_mode/operand.rs @@ -0,0 +1,17 @@ +use yaxpeax_arch::{Decoder, LengthedInstruction}; +use yaxpeax_x86::long_mode::{DecodeError, InstDecoder, Opcode}; + +#[test] +fn register_widths() { + assert_eq!(Operand::Register(RegSpec::rsp()).width(), 8); + assert_eq!(Operand::Register(RegSpec::esp()).width(), 4); + assert_eq!(Operand::Register(RegSpec::sp()).width(), 2); + assert_eq!(Operand::Register(RegSpec::cl()).width(), 1); + assert_eq!(Operand::Register(RegSpec::ch()).width(), 1); + assert_eq!(Operand::Register(RegSpec::gs()).width(), 2); +} + +#[test] +fn memory_widths() { + assert_eq!(Operand::RegDeref(RegSpec::rsp()).width(), 8); +} |