'Ensures that lifted loops are handled correctly in obj mode'

def test_exercise_code_path_with_lifted_loop(self):

    def bar(x):
        return x
    def foo(x):
        h = 0.0
        for k in range(x):
            h = (h + k)
        if x:
            h = (h - bar(x))
        return h
    flags = Flags()
    flags.set('enable_pyobject')
    flags.set('enable_looplift')
    cres = compile_isolated(foo, [types.intp], flags=flags)
    ta = cres.type_annotation
    buf = StringIO()
    ta.html_annotate(buf)
    output = buf.getvalue()
    buf.close()
    self.assertIn('bar', output)
    self.assertIn('foo', output)
    self.assertIn('LiftedLoop', output)
