Add expected state to case_addze for addze in alu_cases unit test
authorR Veera Kumar <vklr@vkten.in>
Thu, 11 Nov 2021 05:39:12 +0000 (11:09 +0530)
committerR Veera Kumar <vklr@vkten.in>
Thu, 11 Nov 2021 05:39:12 +0000 (11:09 +0530)
Now for only addze opcode
Removed a not needed self.add_case line

src/openpower/test/alu/alu_cases.py

index f7041d38bc5adbf57a9cdc312a36a3ad3081fc74..78303852b83e176c6ff38e45017d7d0c822799a8 100644 (file)
@@ -119,9 +119,13 @@ class ALUTestCase(TestAccumulatorBase):
             lst = [f"{choice} 6, 16"]
             initial_regs = [0] * 32
             initial_regs[16] = 0x00ff00ff00ff0080
-            self.add_case(Program(lst, bigendian), initial_regs)
-
-        self.add_case(Program(lst, bigendian), initial_regs)
+            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)
 
     def case_addis_nonzero_r0_regression(self):
         lst = [f"addis 3, 0, 1"]