Add expected state to case_addme_ca_1 in alu_cases unit test
authorR Veera Kumar <vklr@vkten.in>
Mon, 22 Nov 2021 01:52:15 +0000 (07:22 +0530)
committerR Veera Kumar <vklr@vkten.in>
Mon, 22 Nov 2021 01:52:15 +0000 (07:22 +0530)
src/openpower/test/alu/alu_cases.py

index ab622d3d2cb343cac02ce6726bf962402f3f2b60..e935362207c781340bc1a2e38bd0ea44601baeea 100644 (file)
@@ -123,8 +123,17 @@ class ALUTestCase(TestAccumulatorBase):
                 xer = SelectableInt(0, 64)
                 xer[XER_bits['CA']] = 1 # input carry is 1 (differs from above)
                 initial_sprs[special_sprs['XER']] = xer
+                e = ExpectedState(pc=4)
+                e.intregs[16] = value
+                e.ca = 0x3
+                if value == 0x7ffffffff:
+                    e.intregs[6] = 0x7ffffffff
+                else:
+                    e.intregs[6] = 0xffff80000
+                if '.' in choice:
+                    e.crregs[0] = 0x4
                 self.add_case(Program(lst, bigendian),
-                              initial_regs, initial_sprs)
+                              initial_regs, initial_sprs, expected=e)
 
     def case_addme_ca_so_4(self):
         """test of SO being set