test_maxint, add zero onto 0xffffffffffffff
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 10 May 2021 17:00:47 +0000 (18:00 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 10 May 2021 17:00:47 +0000 (18:00 +0100)
src/openpower/decoder/selectable_int.py

index 2afe50e67d5887e81ac8bde6307aa4a34d510c88..1481f289d9958a00f6dc6e9cfb9c0bd324663c87 100644 (file)
@@ -555,6 +555,12 @@ class SelectableIntTestCase(unittest.TestCase):
         self.assertTrue(a != b)
         self.assertFalse(a == b)
 
+    def test_maxint(self):
+        a = SelectableInt(0xffffffffffffffff, bits=64)
+        b = SelectableInt(0, bits=64)
+        result = a + b
+        self.assertTrue(result.value == 0xffffffffffffffff)
+
 
 if __name__ == "__main__":
     unittest.main()