'Verify that annotation works as expected with two lifted loops'

def test_annotate_2(self):

    from numba import jit
    def bar():
        pass
    def foo(x):
        bar()
        for i in range(x.size):
            x[i] += 1
        for j in range(x.size):
            x[j] *= 2
        return x
    cfoo = jit(foo)
    x = np.arange(10)
    xcopy = x.copy()
    r = cfoo(x)
    np.testing.assert_equal(r, ((xcopy + 1) * 2))
    buf = utils.StringIO()
    cfoo.inspect_types(file=buf)
    annotation = buf.getvalue()
    buf.close()
    self.assertIn('The    function    contains    lifted    loops', annotation)
    line1 = (foo.__code__.co_firstlineno + 3)
    line2 = (foo.__code__.co_firstlineno + 6)
    self.assertIn('Loop    at    line    {line}'.format(line=line1), annotation)
    self.assertIn('Loop    at    line    {line}'.format(line=line2), annotation)
