Add expected state to all of case_addze in alu_cases unit test
authorR Veera Kumar <vklr@vkten.in>
Sun, 21 Nov 2021 11:22:28 +0000 (16:52 +0530)
committerR Veera Kumar <vklr@vkten.in>
Sun, 21 Nov 2021 11:22:28 +0000 (16:52 +0530)
src/openpower/test/alu/alu_cases.py

index e03ee7a78061d9207d9d0cfcf44aed5d15c3bdee..e743f749bdf7a6a1760940db7dc0ca639dae05e7 100644 (file)
@@ -159,13 +159,12 @@ class ALUTestCase(TestAccumulatorBase):
             lst = [f"{choice} 6, 16"]
             initial_regs = [0] * 32
             initial_regs[16] = 0x00ff00ff00ff0080
-            if choice == "addze":
-                e = ExpectedState(pc=4)
-                e.intregs[6] = 0xff00ff00ff0080
-                e.intregs[16] = 0xff00ff00ff0080
-                self.add_case(Program(lst, bigendian), initial_regs, expected=e)
-            else:
-                self.add_case(Program(lst, bigendian), initial_regs)
+            e = ExpectedState(pc=4)
+            e.intregs[16] = 0xff00ff00ff0080
+            e.intregs[6] = 0xff00ff00ff0080
+            if '.' in choice:
+                e.crregs[0] = 0x4
+            self.add_case(Program(lst, bigendian), initial_regs, expected=e)
 
     def case_addis_nonzero_r0_regression(self):
         lst = [f"addis 3, 0, 1"]