From 3b9a23948a7c86b703ab7dfc84da23d827d6139c Mon Sep 17 00:00:00 2001 From: AmauryBrodu <60550980+AmauryBrodu@users.noreply.github.com> Date: Thu, 10 Nov 2022 00:39:11 +0100 Subject: [PATCH] add of the test function for opwi instructions --- src/print.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) 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