add sc test to TestTrapCases
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 18 Oct 2023 20:21:48 +0000 (21:21 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 18 Oct 2023 20:21:48 +0000 (21:21 +0100)
src/openpower/test/trap/trap_cases.py

index 1501b8ab32af26f888834f998f1695d4ecb69763..704102d282e274b5eb7567f28ead3ce71be3a6c3 100644 (file)
@@ -51,6 +51,16 @@ class TrapTestCase(TestAccumulatorBase):
         self.add_case(Program(lst, bigendian),
                       initial_regs, initial_sprs)
 
+    def case_1_sc(self):
+        lst = ["sc 0"]
+        initial_regs = [0] * 32
+        initial_regs[1] = 1
+        initial_sprs = {'SRR0': 0x12345678, 'SRR1': 0x5678}
+        e = ExpectedState(pc=0xc00)
+        e.intregs[1] = 1
+        self.add_case(Program(lst, bigendian),
+                      initial_regs, initial_sprs)
+
     def case_1_rfid(self):
         lst = ["rfid"]
         initial_regs = [0] * 32