<s> from __future__ import print_function <EOL> import gc <EOL> from numba import jit , int32 <EOL> from numba import unittest_support as unittest <EOL> def foo ( a , b ) : <EOL> return a + b <EOL> def bar ( a , b ) : <EOL> return cfoo ( a , b ) + b <EOL> @ jit <EOL> def inner ( x , y ) : <EOL> return x + y <EOL> @ jit ( nopython = True ) <EOL> def outer ( x , y ) : <EOL> return inner ( x , y ) <EOL> class TestInterProc ( unittest . TestCase ) : <EOL> def test_bar_call_foo ( self ) : <EOL> global cfoo <EOL> cfoo = jit ( ( int32 , int32 ) , nopython = True ) ( foo ) <EOL> cbar = jit ( ( int32 , int32 ) , nopython = True ) ( bar ) <EOL> self . assertTrue ( cbar ( <NUM_LIT:1> , <NUM_LIT:2> ) , <NUM_LIT:1> + <NUM_LIT:2> + <NUM_LIT:2> ) <EOL> def test_bar_call_foo_compiled_twice ( self ) : <EOL> global cfoo <EOL> for i in range ( <NUM_LIT:2> ) : <EOL> cfoo = jit ( ( int32 , int32 ) , nopython = True ) ( foo ) <EOL> gc . collect ( ) <EOL> cbar = jit ( ( int32 , int32 ) , nopython = True ) ( bar ) <EOL> self . assertTrue ( cbar ( <NUM_LIT:1> , <NUM_LIT:2> ) , <NUM_LIT:1> + <NUM_LIT:2> + <NUM_LIT:2> ) <EOL> def test_callsite_compilation ( self ) : <EOL> self . assertEqual ( outer ( <NUM_LIT:1> , <NUM_LIT:2> ) , <NUM_LIT:1> + <NUM_LIT:2> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
