diff --git a/test/TinyRAM/Spec/EndToEndSpec.hs b/test/TinyRAM/Spec/EndToEndSpec.hs index 91dae8b..ee694b8 100644 --- a/test/TinyRAM/Spec/EndToEndSpec.hs +++ b/test/TinyRAM/Spec/EndToEndSpec.hs @@ -43,6 +43,7 @@ spec = describe "TinyRAM end to end" $ do negative8bitTestCase orTestCase orFlagTestCase + orPreFlagTestCase --xorTestCase --bugged reported addTestNegativeTestCase subTestCase @@ -722,6 +723,21 @@ orFlagTestCase = answer <- execute program (InputTape []) (InputTape []) answer `shouldBe` Right 63 +orPreFlagTestCase :: Spec +orPreFlagTestCase = + it "answers 63" $ do + let program = + construct + [ Mov (reg' 2) (imm 58), + Mov (reg' 0) (imm 0), + Cmov (reg' 0) (imm 1), + Or (reg' 0) (reg' 2) (imm 15), + --Cmov (reg' 0) (imm 1), + Answer (reg 0) + ] + answer <- execute program (InputTape []) (InputTape []) + answer `shouldBe` Right 63 + --xorTestCase -- ; TinyRAM V=1.000 W=16 K=16 -- mov r2, 15