+
    Bi                     0    ^ RI t ^ RIHt  ! R R]4      tR# )    N)CodegenTestCasec                   J   a  ] tR t^t o R tR tR tR tR tR t	R t
RtV tR	# )
IsolatedCodeGenTestsc                   V Uu. uF  p\        V\        4      '       g   K  VNK  	  ppV Uu. uF  p\        V\        4      '       d   K  VNK  	  ppV P                  W4       V P                  \	        VP                  4       4      \	        V4      4       \        VP                  4       V4       F  w  rVV P                  WV4       K  	  R # u upi u upi )N)
isinstancelistassertInstructionsMatchassertEquallen
get_nestedzip!assertInstructionsMatch_recursive)selfinstsexpected_instsiexpected_nestedn_insts
n_expecteds   &&&    1/usr/lib/python3.14/test/test_compiler_codegen.pyr   6IsolatedCodeGenTests.assertInstructionsMatch_recursive
   s    &4Ln
1d8K11nL%3O^:a;N!!^O$$U;U--/0#o2FG#&u'7'7'9?#KG227G $L	 MOs   CCCCc                x    ^ RI pVP                  VRR4      pV P                  V4      pV P                  WR4       R# )r   Nz
my_file.pyexec)astparsegenerate_coder   )r   snippetr   r   ar   s   &&&   r   codegen_test!IsolatedCodeGenTests.codegen_test   s5    IIg|V4""1%..uE    c                    R pV P                  4       pRRRRRV P                  4       ;p^3RRV P                  4       ;p3VR	VR
RR.pV P                  W4       R# )z42 if True else 24NPOP_JUMP_IF_FALSEJUMP_NO_INTERRUPTRESUMEr   r   ANNOTATIONS_PLACEHOLDERN)
LOAD_CONSTr      )TO_BOOLr   r*   )r)   r*   r*   )r)      r*   POP_TOPNr)   r*   RETURN_VALUENLabelr   )r   r   	false_lblexit_lblexpecteds   &    r   test_if_expression'IsolatedCodeGenTests.test_if_expression   sr    &JJL	-  tzz|";)Q?  djjl":(; "
 	',r!   c                    R pV P                  4       pRRRRV P                  4       ;pRV P                  4       ;p^3RR	R
RRRRRV3VRRRR.pV P                  W4       R# )zfor x in l:
	print(x)NFOR_ITERJUMPr%   r'   )	LOAD_NAMEr   r*   )GET_ITERNr*   )NOPNr*   r*   )
STORE_NAMEr*   r*   )r<   r,   r,   )	PUSH_NULLNr,   )r<   r*   r,   )CALLr*   r,   r-   )END_FORN)POP_ITERNr)   r   r0   r2   )r   r   r4   loop_lblr5   r6   s   &     r   test_for_loop"IsolatedCodeGenTests.test_for_loop,   s    +JJL	-!

$HTZZ\115 "X"'
* 	',r!   c           	     l    \         P                  ! R 4      pRRRRRRR. R	O.pV P                  W4       R# )
z=
            def f(x):
                return x + 42
        Nr&   r   r'   rD   MAKE_FUNCTIONNr?   r   r/   r0   )rI   )	LOAD_FASTr   r)   *   )	BINARY_OPr   r0   rD   r0   textwrapdedentr   r   r   r6   s   &  r   test_function"IsolatedCodeGenTests.test_functionF   sH    // #  -#"	
( 	',r!   c                    \         P                  ! R 4      pRRRRRRRRRRR	R
RRRR. RO. RO..pV P                  W4       R# )z
            def f():
                def h():
                    return 12
                def g():
                    x = 1
                    y = 2
                    z = 3
                    u = 4
                    return 42
        NrI   r'   rD   rJ   rL   r/   r0   
STORE_FASTr   r)   r,   rY   r*   )rI   r>   N)r)      r0   r/   r0   )rI   r/   rX   rZ   r[   )r)      )rY   r,   )r)      )rY   r^   r\   rN   r0   rD   r0   rQ   rT   s   &  r   test_nested_functions*IsolatedCodeGenTests.test_nested_functionsa   sp    // 
# 
 -#" !'!!'!!&'#-
\ 	',r!   c                   R pV P                  \        R4      ;_uu_ 4       pV P                  VR4       RRR4       V P                  XP                  P
                  4       V P                  VP                  P                  ^4       V P                  VP                  P                  ^
4       R#   + '       g   i     L; i)z	return 42z'return' outside functionN)	assertRaisesRegexSyntaxErrorr   assertIsNone	exceptiontextr
   offset
end_offset)r   r   cms   &  r   )test_syntax_error__return_not_in_function>IsolatedCodeGenTests.test_syntax_error__return_not_in_function   s    ##K1LMMQSgt, N",,++,,,a000"5	 NMs   B//B?	 N)__name__
__module____qualname____firstlineno__r   r   r7   rF   rU   r`   rk   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s0     HF-(-4-6:-x6 6r!   r   )rR   test.support.bytecode_helperr   r   rm   r!   r   <module>rv      s     8
[6? [6r!   