Ejemplo n.º 1
0
 def test_input_def(self):
     # Converse of the above.
     src = Rtl(y << iadd_imm(a, 1))
     dst = Rtl(a << iadd_imm(x, 1))
     with self.assertRaisesRegexp(AssertionError,
                                  "'a' used as both input and def"):
         XForm(src, dst)
Ejemplo n.º 2
0
 def test_def_input(self):
     # Src pattern has a def which is an input in dst.
     src = Rtl(a << iadd_imm(x, 1))
     dst = Rtl(y << iadd_imm(a, 1))
     with self.assertRaisesRegexp(AssertionError,
                                  "'a' used as both input and def"):
         XForm(src, dst)
Ejemplo n.º 3
0
 def test_input_def(self):
     # Converse of the above.
     src = Rtl(y << iadd_imm(a, 1))
     dst = Rtl(a << iadd_imm(x, 1))
     with self.assertRaisesRegexp(
             AssertionError,
             "'a' used as both input and def"):
         XForm(src, dst)
Ejemplo n.º 4
0
 def test_def_input(self):
     # Src pattern has a def which is an input in dst.
     src = Rtl(a << iadd_imm(x, 1))
     dst = Rtl(y << iadd_imm(a, 1))
     with self.assertRaisesRegexp(
             AssertionError,
             "'a' used as both input and def"):
         XForm(src, dst)
Ejemplo n.º 5
0
 def test_double_def(self):
     src = Rtl(
             a << iadd_imm(x, 1),
             a << iadd(x, y))
     dst = Rtl(a << iadd(x, y))
     with self.assertRaisesRegexp(AssertionError, "'a' multiply defined"):
         XForm(src, dst)
Ejemplo n.º 6
0
 def test_double_def(self):
     src = Rtl(
             a << iadd_imm(x, 1),
             a << iadd(x, y))
     dst = Rtl(a << iadd(x, y))
     with self.assertRaisesRegexp(AssertionError, "'a' multiply defined"):
         XForm(src, dst)
Ejemplo n.º 7
0
 def test_extra_input(self):
     src = Rtl(a << iadd_imm(x, 1))
     dst = Rtl(a << iadd(x, y))
     with self.assertRaisesRegexp(AssertionError, "extra inputs in dst"):
         XForm(src, dst)
Ejemplo n.º 8
0
 def test_macro_pattern(self):
     src = Rtl(a << iadd_imm(x, y))
     dst = Rtl(
             c << iconst(y),
             a << iadd(x, c))
     XForm(src, dst)
Ejemplo n.º 9
0
 def test_extra_input(self):
     src = Rtl(a << iadd_imm(x, 1))
     dst = Rtl(a << iadd(x, y))
     with self.assertRaisesRegexp(AssertionError, "extra inputs in dst"):
         XForm(src, dst)
Ejemplo n.º 10
0
 def test_macro_pattern(self):
     src = Rtl(a << iadd_imm(x, y))
     dst = Rtl(
             c << iconst(y),
             a << iadd(x, c))
     XForm(src, dst)