+
    :i8                         ^ RI t ^ RIHt ^ RIHt ^ RIHtHtHtH	t	H
t
 ^ RIHt  ! R R] P                  4      t]R8X  d   ] P                   ! 4        R# R# )	    N)contextmanager)ir)typestypingcallconvcpucgutils)
cpu_targetc                   F   a  ] tR t^
t o Rt]R 4       tR tR tR t	Rt
V tR# )TestCompileCachez
Tests that the caching in BaseContext.compile_internal() works correctly by
checking the state of the cache when it is used by the CPUContext.
c              #    "   \         P                  p\         P                  pVP                  4       P	                  R 4      pVP                  V4      ;_uu_ 4        \        P                  ! R4      p\        P                  ! \        P                  \        P                  4      pVP                  P                  VP                  VP                  4      p\         P"                  ! WFR4      pVP                  P%                  V4      pVP&                  '       g   Q hVP)                  R4      p	\        P*                  ! V	4      p
W*WX3x  RRR4       R#   + '       g   i     R# ; i5i)testingtest_moduletest_fnentryN)r
   typing_contexttarget_contextcodegencreate_librarypush_code_libraryr   Moduler   	signaturer   int32	call_convget_function_typereturn_typeargsr	   get_or_insert_functionget_argumentsis_declarationappend_basic_block	IRBuilder)selfr   contextlibmodulesig	llvm_fntyfunctionr   entry_blockbuilders   &          \/var/www/html/photoedit/myenv/lib/python3.14/site-packages/numba/tests/test_compile_cache.py_context_builder_sig_args*TestCompileCache._context_builder_sig_args   s    #22++oo..y9&&s++YY}-F""5;;<C));;COO<?HHFI55f6?AH$$228<D*****"55g>Kll;/GC-- ,+++s   AE&C-E
E&E#		E&c                   R  pR pV P                  4       ;_uu_ 4       w  r4rV\        VP                  4      pV P                  V^ ,           \        VP                  4      4       VP	                  WAWV4       V P                  V^,           \        VP                  4      4       VP	                  WAWV4       V P                  V^,           \        VP                  4      4       VP	                  WBWV4       V P                  V^,           \        VP                  4      4       \
        P                  ! \        P                  \        P                  4      pVP                  P                  VP                  VP                  4      p	\        P                  ! VP                  V	R4      p
VP                  P!                  V
4      pV
P"                  '       g   Q hV
P%                  R4      p\&        P(                  ! V4      pVP	                  WW4       V P                  V^,           \        VP                  4      4       RRR4       R#   + '       g   i     R# ; i)c                     ^V ,          # )    is   &r,   times2+TestCompileCache.test_cache.<locals>.times2%       Q3J    c                     V ^,          # )   r2   r3   s   &r,   times3+TestCompileCache.test_cache.<locals>.times3(   r7   r8   	test_fn_2r   N)r-   lencached_internal_funcassertEqualcompile_internalr   r   r   float64r   r   r   r   r	   r   r&   r   r    r!   r   r"   )r#   r5   r;   r$   r+   r'   r   initial_cache_sizesig2
llvm_fnty2	function2args2entry_block2builder2s   &             r,   
test_cacheTestCompileCache.test_cache$   s   		 ++-- 2
c!$W%A%A!B/!3 !=!=>@ $$Wc@/!3 !=!=>@
 $$Wc@/!3 !=!=>@
 $$Wc@/!3 !=!=>@ ##EMM5==AD **<<T=M=M<@IIGJ66w~~7A;PI%%33I>E+++++$77@L||L1H $$XtC/!3 !=!=>@M .---s   HII	c                P   R pV P                  4       ;_uu_ 4       w  r#rEV! ^^4      pV! ^^4      pV! ^^4      p\        VP                  4      p	VP                  W6WE4      p
V P	                  V	^,           \        VP                  4      4       VP                  W7WE4      pV P	                  V	^,           \        VP                  4      4       VP                  W8WE4      pV P	                  V	^,           \        VP                  4      4       RRR4       R#   + '       g   i     R# ; i)z@
Caching must not mix up closures reusing the same code object.
c                    a V3R  lpV# )c                    < SV ,           # Nr2   )zys   &r,   f?TestCompileCache.test_closures.<locals>.make_closure.<locals>.fY   s    1ur8   r2   )xrQ   rR   s   &f r,   make_closure4TestCompileCache.test_closures.<locals>.make_closureX   s    Hr8   N)r-   r>   r?   rA   r@   )r#   rU   r$   r+   r'   r   clo11clo12clo22rC   res1res2res3s   &            r,   test_closuresTestCompileCache.test_closuresT   s   	
 ++-- 2
c !A&E A&E A&E!$W%A%A!B++GCFD/!3 !=!=>@++GCFD/!3 !=!=>@ ++GCFD/!3 !=!=>@! .---s   C.DD%	c                |  aaa R o\         P                  ! \        P                  \        P                  4      oVVV3R lpV P	                  4       ;_uu_ 4       w  por4\
        P                  ! RV4      p\
        P                  ! RV4      pVP                  VR7      pVP                  VR7      pVP                  VR7      p	\        VP                  4      p
V P                  V
^ ,           \        VP                  4      4       V! V4       V P                  V
^,           \        VP                  4      4       V! V4       V P                  V
^,           \        VP                  4      4       V! V	4       V P                  V
^,           \        VP                  4      4       RRR4       R#   + '       g   i     R# ; i)z1
Caching must not mix up different error models.
c                     R V ,          # )g      ?r2   )rT   s   &r,   inv.TestCompileCache.test_error_model.<locals>.invt   s    7Nr8   c                 *   < V P                  SSS4      # rO   )compile_subroutine)r$   r+   ra   inv_sigs   &r,   compile_inv6TestCompileCache.test_error_model.<locals>.compile_invy   s    --gsGDDr8   pythonnumpy)error_modelN)r   r   r   rB   r-   r   create_error_model	subtargetr>   r?   r@   )r#   rf   r$   r'   r   py_error_modelnp_error_modelpy_context1py_context2
np_contextrC   r+   ra   re   s   &          @@@r,   test_error_model!TestCompileCache.test_error_modelp   sv   	 ""5==%--@	E ++-- 2
Wc%887KN%88'JN!+++GK!+++GK **~*FJ!$W%A%A!B /!3 !=!=>@ $/!3 !=!=>@$/!3 !=!=>@ 
#/!3 !=!=>@1 .---s   EF**F;	r2   N)__name__
__module____qualname____firstlineno____doc__r   r-   rJ   r]   rr   __static_attributes____classdictcell__)__classdict__s   @r,   r   r   
   s7     
 . .&.@`@8%@ %@r8   r   __main__)unittest
contextlibr   llvmliter   
numba.corer   r   r   r   r	   numba.core.registryr
   TestCaser   rt   mainr2   r8   r,   <module>r      sF     %  < < *K@x(( K@\ zMMO r8   