Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

demonstrates bug with orPreFlagTestCase #92

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions test/TinyRAM/Spec/EndToEndSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spec = describe "TinyRAM end to end" $ do
negative8bitTestCase
orTestCase
orFlagTestCase
orPreFlagTestCase
--xorTestCase --bugged reported
addTestNegativeTestCase
subTestCase
Expand Down Expand Up @@ -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
Expand Down