Beispiel #1
0
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import

import unittest
from pykit.ir import pretty, from_assembly

source = u"""\
global %foo = Float64

function Int32 func() {
block1:
    %foo = (Int32) add()

}
"""

program = from_assembly(source)

class TestPretty(unittest.TestCase):
    def test_pretty(self):
        result = pretty.pretty(program)
        self.assertEqual(source.strip(), result.strip())
Beispiel #2
0
 def setUp(self):
     self.f = from_assembly(testfunc)
     self.b = Builder(self.f)
Beispiel #3
0
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import

import unittest
from pykit.ir import pretty, from_assembly

source = u"""\
global %foo = Float64

function Int32 func() {
block1:
    %foo = (Int32) add()

}
"""

program = from_assembly(source)


class TestPretty(unittest.TestCase):
    def test_pretty(self):
        result = pretty.pretty(program)
        self.assertEqual(source.strip(), result.strip())