diff --git a/src/print.rs b/src/print.rs index 9b5bede..e51f0d2 100644 --- a/src/print.rs +++ b/src/print.rs @@ -339,5 +339,15 @@ mod test { assert_eq!("sraw x28, x17, x16", print::print(sraw, 0)); } + #[test] + fn test_opwi() { + let addwi: decode::Instruction =decode::decode(0b000000000000_10001_000_11100_0011011); + let sllwi: decode::Instruction = decode::decode(0b0000000_10000_10001_001_11100_0011011); + let srai: decode::Instruction = decode::decode(0b010000010001_10001_101_11100_0010011); + assert_eq!("addwi x28, x17, x0", print::print(addwi, 0)); + assert_eq!("slli x28, x17, x16", print::print(sllwi, 0)); + assert_eq!("srai x28, x17, 17", print::print(srai, 0)); + + } } \ No newline at end of file