aboutsummaryrefslogtreecommitdiffstats
path: root/bindings/python/llvm/tests
diff options
context:
space:
mode:
authorGregory Szorc <gregory.szorc@gmail.com>2012-03-10 05:50:56 +0000
committerGregory Szorc <gregory.szorc@gmail.com>2012-03-10 05:50:56 +0000
commitb7487d4edc34fa22b697d0874331c163ed2c6847 (patch)
treef3a31fa08bc4c31318197ccf7fef3d210c4adc36 /bindings/python/llvm/tests
parent61e22cd85cd4c84fff391da67018c92bf21a8e19 (diff)
downloadexternal_llvm-b7487d4edc34fa22b697d0874331c163ed2c6847.zip
external_llvm-b7487d4edc34fa22b697d0874331c163ed2c6847.tar.gz
external_llvm-b7487d4edc34fa22b697d0874331c163ed2c6847.tar.bz2
[llvm.py] Define enumerations from Core.h; add OpCode class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152483 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/python/llvm/tests')
-rw-r--r--bindings/python/llvm/tests/test_core.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/bindings/python/llvm/tests/test_core.py b/bindings/python/llvm/tests/test_core.py
index be3df66..8123e15 100644
--- a/bindings/python/llvm/tests/test_core.py
+++ b/bindings/python/llvm/tests/test_core.py
@@ -1,8 +1,17 @@
-from llvm.core import MemoryBuffer
-
from .base import TestBase
+from ..core import OpCode
+from ..core import MemoryBuffer
class TestCore(TestBase):
+ def test_opcode(self):
+ self.assertTrue(hasattr(OpCode, 'Ret'))
+ self.assertTrue(isinstance(OpCode.Ret, OpCode))
+ self.assertEqual(OpCode.Ret.value, 1)
+
+ op = OpCode.from_value(1)
+ self.assertTrue(isinstance(op, OpCode))
+ self.assertEqual(op, OpCode.Ret)
+
def test_memory_buffer_create_from_file(self):
source = self.get_test_binary()