Commits

Hakan Ardo committed 65946bb

simplify test

Comments (0)

Files changed (1)

pypy/jit/metainterp/optimizeopt/test/test_multilabel.py

         with raises(InvalidLoop):
             self.optimize_loop(ops, ops)
 
-    def test_maybe_issue1045_related(self):
+    def test_issue1045(self):
         ops = """
-        [p8]
-        p54 = getfield_gc(p8, descr=valuedescr)
-        mark_opaque_ptr(p54)
-        i55 = getfield_gc(p54, descr=nextdescr)
-        p57 = new_with_vtable(ConstClass(node_vtable))
-        setfield_gc(p57, i55, descr=otherdescr)
-        p69 = new_with_vtable(ConstClass(node_vtable))
-        setfield_gc(p69, i55, descr=otherdescr)
-        i71 = int_eq(i55, -9223372036854775808)
-        guard_false(i71) []
-        i73 = int_mod(i55, 2)
-        i75 = int_rshift(i73, 63)
-        i76 = int_and(2, i75)
-        i77 = int_add(i73, i76)
-        p79 = new_with_vtable(ConstClass(node_vtable))
-        setfield_gc(p79, i77, descr=otherdescr)
-        i81 = int_eq(i77, 1)
-        guard_false(i81) []
-        i0 = int_ge(i55, 1)
-        guard_true(i0) []
-        label(p57)
-        jump(p57)
-        """
-        expected = """
-        [p8]
-        p54 = getfield_gc(p8, descr=valuedescr)
-        i55 = getfield_gc(p54, descr=nextdescr)
-        i71 = int_eq(i55, -9223372036854775808)
-        guard_false(i71) []
+        [i55]
         i73 = int_mod(i55, 2)
         i75 = int_rshift(i73, 63)
         i76 = int_and(2, i75)
         i77 = int_add(i73, i76)
         i81 = int_eq(i77, 1)
-        guard_false(i81) []
         i0 = int_ge(i55, 1)
         guard_true(i0) []
         label(i55)
-        jump(i55)
-        """
-        self.optimize_loop(ops, expected)
-
-    def test_issue1045(self):
-        ops = """
-        [p8]
-        p54 = getfield_gc(p8, descr=valuedescr)
-        mark_opaque_ptr(p54)
-        i55 = getfield_gc(p54, descr=nextdescr)
-        p57 = new_with_vtable(ConstClass(node_vtable))
-        setfield_gc(p57, i55, descr=otherdescr)
-        p69 = new_with_vtable(ConstClass(node_vtable))
-        setfield_gc(p69, i55, descr=otherdescr)
-        i71 = int_eq(i55, -9223372036854775808)
-        guard_false(i71) []
-        i73 = int_mod(i55, 2)
-        i75 = int_rshift(i73, 63)
-        i76 = int_and(2, i75)
-        i77 = int_add(i73, i76)
-        p79 = new_with_vtable(ConstClass(node_vtable))
-        setfield_gc(p79, i77, descr=otherdescr)
-        i81 = int_eq(i77, 1)
-        guard_false(i81) []
-        i0 = int_ge(i55, 1)
-        guard_true(i0) []
-        label(p57)
         i3 = int_mod(i55, 2)
-        escape(i3)
         i5 = int_rshift(i3, 63)
         i6 = int_and(2, i5)
         i7 = int_add(i3, i6)
         i8 = int_eq(i7, 1)
         escape(i8)
-        jump(p57)
+        jump(i55)
         """
         expected = """
-        [p8]
-        p54 = getfield_gc(p8, descr=valuedescr)
-        i55 = getfield_gc(p54, descr=nextdescr)
-        i71 = int_eq(i55, -9223372036854775808)
-        guard_false(i71) []
+        [i55]
         i73 = int_mod(i55, 2)
         i75 = int_rshift(i73, 63)
         i76 = int_and(2, i75)
         i77 = int_add(i73, i76)
         i81 = int_eq(i77, 1)
-        guard_false(i81) []
         i0 = int_ge(i55, 1)
         guard_true(i0) []
-        label(i55, i73)
-        escape(i73)
-        escape(i73)
-        jump(i55, i73)
+        label(i55, i81)
+        escape(i81)
+        jump(i55, i81)
         """
         self.optimize_loop(ops, expected)