Print all the bits in the addend.
[oota-llvm.git] / test / Scripts / common_dump.py
index 3d69c3fb27f2576c05cd695be34100fa1651719a..cd0c493451e158ce48ce81a8d999aadc0e76c820 100644 (file)
@@ -40,7 +40,8 @@ def HexDump(val, numBits=32):
     4. Do print 0x Why?
        so that they can be easily distinguished using sed/rx
     """
+    assert 0 <= val < (1 << numBits)
+
     val = val & (( 1 << numBits) - 1)
     newFmt = "0x%0" + "%d" % (numBits / 4) + "x"
     return newFmt % val
-