diff options
Diffstat (limited to 'test/long_mode')
| -rw-r--r-- | test/long_mode/regspec.rs | 18 | 
1 files changed, 17 insertions, 1 deletions
| diff --git a/test/long_mode/regspec.rs b/test/long_mode/regspec.rs index e126ac3..f92ec89 100644 --- a/test/long_mode/regspec.rs +++ b/test/long_mode/regspec.rs @@ -1,4 +1,4 @@ -use yaxpeax_x86::long_mode::RegSpec; +use yaxpeax_x86::long_mode::{register_class, RegSpec};  use std::collections::{BTreeMap, HashMap};  #[test] @@ -39,3 +39,19 @@ fn test_bank_names() {      assert_eq!(RegSpec::ymm0().class().name(), "ymm");      assert_eq!(RegSpec::zmm0().class().name(), "zmm");  } + +// this should compile. +#[test] +fn match_bank_kind() { +    match RegSpec::al().class() { +        register_class::X => { +            panic!("al is an xmm register? don't think so"); +        } +        register_class::B => { +            println!("al is a byte register"); +        } +        other => { +            panic!("unknown register kind: {:?}", other); +        } +    } +} | 
