add native asm test
This commit is contained in:
parent
7b0f3cc0c7
commit
984bfece2d
1 changed files with 23 additions and 0 deletions
|
|
@ -635,6 +635,29 @@ tests.append(TestNative)
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
class TestNativeAsm(unittest.TestCase):
|
||||||
|
|
||||||
|
def test_asm(self):
|
||||||
|
m = Module.new('module1')
|
||||||
|
|
||||||
|
foo = m.add_function(Type.function(Type.int(),
|
||||||
|
[Type.int(), Type.int()]),
|
||||||
|
name="foo")
|
||||||
|
bldr = Builder.new(foo.append_basic_block('entry'))
|
||||||
|
x = bldr.add(foo.args[0], foo.args[1])
|
||||||
|
bldr.ret(x)
|
||||||
|
|
||||||
|
att_syntax = m.to_native_assembly()
|
||||||
|
os.environ["LLVMPY_OPTIONS"] = "-x86-asm-syntax=intel"
|
||||||
|
lc.parse_environment_options(sys.argv[0], "LLVMPY_OPTIONS")
|
||||||
|
intel_syntax = m.to_native_assembly()
|
||||||
|
|
||||||
|
self.assertNotEqual(att_syntax, intel_syntax)
|
||||||
|
|
||||||
|
tests.append(TestNativeAsm)
|
||||||
|
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
class TestUses(unittest.TestCase):
|
class TestUses(unittest.TestCase):
|
||||||
|
|
||||||
def test_uses(self):
|
def test_uses(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue