Add basic floating point register test.
[riscv-tests.git] / debug / testlib.py
index a38b99b0ea1d4cffe7a918476eb2a787941d0350..b20e2ffca1d69ddd4186a5d579430f3de18f9636 100644 (file)
@@ -238,6 +238,13 @@ class Gdb(object):
         value = int(output.split(':')[1].strip(), 0)
         return value
 
         value = int(output.split(':')[1].strip(), 0)
         return value
 
+    def p_raw(self, obj):
+        output = self.command("p %s" % obj)
+        m = re.search("Cannot access memory at address (0x[0-9a-f]+)", output)
+        if m:
+            raise CannotAccess(int(m.group(1), 0))
+        return output.split('=')[-1].strip()
+
     def p(self, obj):
         output = self.command("p/x %s" % obj)
         m = re.search("Cannot access memory at address (0x[0-9a-f]+)", output)
     def p(self, obj):
         output = self.command("p/x %s" % obj)
         m = re.search("Cannot access memory at address (0x[0-9a-f]+)", output)
@@ -444,6 +451,10 @@ def assertGreater(a, b):
     if not a > b:
         raise TestFailed("%r not greater than %r" % (a, b))
 
     if not a > b:
         raise TestFailed("%r not greater than %r" % (a, b))
 
+def assertLess(a, b):
+    if not a < b:
+        raise TestFailed("%r not less than %r" % (a, b))
+
 def assertTrue(a):
     if not a:
         raise TestFailed("%r is not True" % a)
 def assertTrue(a):
     if not a:
         raise TestFailed("%r is not True" % a)