We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4203ab1 commit ea489dbCopy full SHA for ea489db
riscv/src/register/mstatus.rs
@@ -593,3 +593,19 @@ pub unsafe fn set_mbe(endianness: Endianness) {
593
},
594
}
595
596
+
597
+#[cfg(test)]
598
+mod test {
599
+ use super::*;
600
601
+ #[test]
602
+ fn test_mpp() {
603
+ let mut mstatus = Mstatus { bits: 0 };
604
+ mstatus = mstatus.update_mpp(MPP::User);
605
+ assert_eq!(mstatus.mpp(), MPP::User);
606
+ mstatus = mstatus.update_mpp(MPP::Machine);
607
+ assert_eq!(mstatus.mpp(), MPP::Machine);
608
+ mstatus = mstatus.update_mpp(MPP::Supervisor);
609
+ assert_eq!(mstatus.mpp(), MPP::Supervisor);
610
+ }
611
+}
0 commit comments