diff options
author | Gregory Szorc <gregory.szorc@gmail.com> | 2012-12-01 21:57:30 +0000 |
---|---|---|
committer | Gregory Szorc <gregory.szorc@gmail.com> | 2012-12-01 21:57:30 +0000 |
commit | fdddf771716a48857a1044abc7917886bf0bf719 (patch) | |
tree | d25584980bbdcf41b96fbd5777dba7e542750a62 /bindings/python/llvm/tests | |
parent | 9756ca7ba0c7f6c3b1e76ee12ca27ddca04be9d7 (diff) | |
download | external_llvm-fdddf771716a48857a1044abc7917886bf0bf719.zip external_llvm-fdddf771716a48857a1044abc7917886bf0bf719.tar.gz external_llvm-fdddf771716a48857a1044abc7917886bf0bf719.tar.bz2 |
[python] Add markup option to disassembler
Patch contributed by Wladimir J. van der Laan <laanwj@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169102 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/python/llvm/tests')
-rw-r--r-- | bindings/python/llvm/tests/test_disassembler.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/bindings/python/llvm/tests/test_disassembler.py b/bindings/python/llvm/tests/test_disassembler.py index 545e866..46d12f7 100644 --- a/bindings/python/llvm/tests/test_disassembler.py +++ b/bindings/python/llvm/tests/test_disassembler.py @@ -1,6 +1,6 @@ from .base import TestBase -from ..disassembler import Disassembler +from ..disassembler import Disassembler, Option_UseMarkup class TestDisassembler(TestBase): def test_instantiate(self): @@ -26,3 +26,14 @@ class TestDisassembler(TestBase): self.assertEqual(instructions[0], (0, 3, '\tjcxz\t-127')) self.assertEqual(instructions[1], (3, 2, '\taddl\t%eax, %edi')) + + def test_set_options(self): + sequence = '\x10\x40\x2d\xe9' + triple = 'arm-linux-android' + + disassembler = Disassembler(triple) + disassembler.set_options(Option_UseMarkup) + count, s = disassembler.get_instruction(sequence) + print s + self.assertEqual(count, 4) + self.assertEqual(s, '\tpush\t{<reg:r4>, <reg:lr>}') |