split up regression cases so that a single Rc=1 add can be tested
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 17 Nov 2021 14:45:47 +0000 (14:45 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 17 Nov 2021 14:45:47 +0000 (14:45 +0000)
src/openpower/test/alu/alu_cases.py

index 0e57a6ee051d2b75be7ddb5d4ccf6d3e6d44a306..63c556fd44e27c7e8674b0bca9403b37bcbffec6 100644 (file)
@@ -12,6 +12,18 @@ import unittest
 class ALUTestCase(TestAccumulatorBase):
 
     def case_1_regression(self):
+        lst = [f"add. 3, 1, 2"]
+        initial_regs = [0] * 32
+        initial_regs[1] = 0xc523e996a8ff6215
+        initial_regs[2] = 0xe1e5b9cc9864c4a8
+        e = ExpectedState(pc=4)
+        e.intregs[1] = 0xc523e996a8ff6215
+        e.intregs[2] = 0xe1e5b9cc9864c4a8
+        e.intregs[3] = 0xa709a363416426bd
+        e.crregs[0] = 0x8
+        self.add_case(Program(lst, bigendian), initial_regs, expected=e)
+
+    def case_2_regression(self):
         lst = [f"extsw 3, 1"]
         initial_regs = [0] * 32
         initial_regs[1] = 0xb6a1fc6c8576af91
@@ -48,17 +60,6 @@ class ALUTestCase(TestAccumulatorBase):
         e.intregs[3] = 0xffffffffffffffa0
         self.add_case(Program(lst, bigendian), initial_regs, expected=e)
 
-        lst = [f"add. 3, 1, 2"]
-        initial_regs = [0] * 32
-        initial_regs[1] = 0xc523e996a8ff6215
-        initial_regs[2] = 0xe1e5b9cc9864c4a8
-        e = ExpectedState(pc=4)
-        e.intregs[1] = 0xc523e996a8ff6215
-        e.intregs[2] = 0xe1e5b9cc9864c4a8
-        e.intregs[3] = 0xa709a363416426bd
-        e.crregs[0] = 0x8
-        self.add_case(Program(lst, bigendian), initial_regs, expected=e)
-
         lst = [f"add 3, 1, 2"]
         initial_regs = [0] * 32
         initial_regs[1] = 0x2e08ae202742baf8