From 9772d66af3f4f97fd4e4787ecf1dbb61cbb0e6c3 Mon Sep 17 00:00:00 2001 From: Michael Nolan Date: Wed, 20 May 2020 11:15:10 -0400 Subject: [PATCH] Add test for edge cases that were previously buggy --- src/soc/fu/logical/test/test_pipe_caller.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/soc/fu/logical/test/test_pipe_caller.py b/src/soc/fu/logical/test/test_pipe_caller.py index 6223a3dd..05e1a816 100644 --- a/src/soc/fu/logical/test/test_pipe_caller.py +++ b/src/soc/fu/logical/test/test_pipe_caller.py @@ -153,6 +153,14 @@ class LogicalTestCase(FHDLTestCase): initial_regs[1] = random.randint(0, (1<<64)-1) self.run_tst_program(Program(lst), initial_regs) + def test_popcnt_edge(self): + insns = ["popcntb", "popcntw", "popcntd"] + for choice in insns: + lst = [f"{choice} 3, 1"] + initial_regs = [0] * 32 + initial_regs[1] = -1 + self.run_tst_program(Program(lst), initial_regs) + def test_cmpb(self): lst = ["cmpb 3, 1, 2"] initial_regs = [0] * 32 -- 2.30.2