aboutsummaryrefslogtreecommitdiff
path: root/test/long_mode/operand.rs
blob: 77ce25696558d8014d82deb85402e4125540df4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use yaxpeax_x86::long_mode::{Operand, RegSpec};

#[test]
fn register_widths() {
    assert_eq!(Operand::Register(RegSpec::rsp()).width(), Some(8));
    assert_eq!(Operand::Register(RegSpec::esp()).width(), Some(4));
    assert_eq!(Operand::Register(RegSpec::sp()).width(), Some(2));
    assert_eq!(Operand::Register(RegSpec::cl()).width(), Some(1));
    assert_eq!(Operand::Register(RegSpec::ch()).width(), Some(1));
    assert_eq!(Operand::Register(RegSpec::gs()).width(), Some(2));
}

#[test]
fn memory_widths() {
    assert_eq!(Operand::RegDeref(RegSpec::rsp()).width(), None);
}