
    /hhl                        S SK r S SKrS SKrS SKrS SKrS SKJr  S SKJr  S r\" 5         \R                  " S5        \R                  " S5         S SKJr  S SKrS SKJr  S SKrS SKrSSS5        S r " S	 S
\R&                  5      r " S S\R&                  5      r " S S\R&                  5      r\S:X  a  \R0                  " 5         gg! , (       d  f       Ni= f)    N)support)
test_toolsc                     [         R                  S:w  a  g [        R                  R	                  [        R                  R	                  [
        5      5      n [        R                  R                  U 5      S   n[        R                  R                  [        R                  " 5       5      S   nX:w  a  [        R                  " SU SU S35      eg )Nwin32r   z`the current working directory and the Python source code directory have different mount drives (z and ))
sysplatformospathdirname__file__	splitrootgetcwdunittestSkipTest)ROOT
root_drive	cwd_drives      B/opt/python-3.13.8/usr/lib/python3.13/test/test_generated_cases.pyskip_if_different_mount_drivesr      s    
||w77??277??845D""4(+J!!"))+.q1I {%
|1.
 	
     cases_generator)	StackItem)Stackc                  ~    [         R                  S:  a  [        R                  " 5       $ [         R                  " 5       $ )N   )r   verbose
contextlibnullcontextcaptured_stderr r   r   handle_stderrr"   '   s,    %%''&&((r   c                       \ rS rSrS rSrg)TestEffects.   c                 
   [        5       n[        SS SS5      =n[        SS SS5      =n[        SS SS5      =n/n[        SS SS5      [        SS SS	5      [        S
S SS5      /nUR                  U5        UR                  U5        UR                  U5        U H  nUR                  U5        M     U R	                  UR
                  R                  5       S5        U R	                  UR                  R                  5       S5        g )Nx 1yopargzzoparg*2bzoparg*4cz-1 - oparg*2 - opargz1 - oparg*2 - oparg + oparg*4)r   r   poppushassertEqualbase_offsetto_c
top_offset)selfstackr'   r*   r,   inputsoutputsouts           r   test_effect_sizesTestEffects.test_effect_sizes/   s    3b#..A3b'22A3b)44A
 c4S)c4Y/c4S)

 			!		!		!CJJsO **//13IJ))..02QRr   r!   N)__name__
__module____qualname____firstlineno__r:   __static_attributes__r!   r   r   r$   r$   .   s    Sr   r$   c                      ^  \ rS rSrS%U 4S jjrS%U 4S jjrS\S\4S jrS rS r	S	 r
S
 rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS rS r S  r!S! r"S" r#S# r$S$r%U =r&$ )&TestGeneratedCasesD   c                 :  > [         TU ]  5         S U l        [        R                  " 5       U l        [        R                  R                  U R
                  S5      U l	        [        R                  R                  U R
                  S5      U l
        [        R                  R                  U R
                  S5      U l        [        R                  R                  U R
                  S5      U l        [        R                  R                  U R
                  S5      U l        g )N	input.txt
output.txtzmetadata.txtzpymetadata.txtzexecutor.txt)supersetUpmaxDifftempfile
gettempdirtemp_dirr
   r   jointemp_input_filenametemp_output_filenametemp_metadata_filenametemp_pymetadata_filenametemp_executor_filenamer5   	__class__s    r   rH   TestGeneratedCases.setUpE   s     ++-#%77<<{#K $&GGLL$M!&(ggll4==.&Q#(*T]]DT(U%&(ggll4==.&Q#r   c                    > U R                   U R                  U R                  U R                  U R                  4 H  n [
        R                  " U5        M     [        TU ]!  5         g !    M2  = fN)	rN   rO   rP   rQ   rR   r
   removerG   tearDownr5   filenamerT   s     r   rY   TestGeneratedCases.tearDownP   sd    $$%%''))''
H		(#
 	s   A((A-inputexpectedc                    [        U R                  S5       nUR                  [        R                  5        UR                  U5        UR                  [        R
                  5        UR                  5         S S S 5        [        5          [        R                  " U R                  /U R                  S5        S S S 5        [        U R                  5       nUR                  5       nU(       aL  US   R                  S5      (       a3  UR                  S5        U(       a  US   R                  S5      (       a  M3  U(       aL  US   R                  S5      (       a3  UR                  S5        U(       a  US   R                  S5      (       a  M3  S S S 5        SR                  W5      nU R                  UR!                  5       UR!                  5       5        g ! , (       d  f       GNc= f! , (       d  f       GN5= f! , (       d  f       Nr= f)Nw+Fr   z// #z    #
rb   rc   r(   )openrN   writeparserBEGIN_MARKER
END_MARKERflushr"   tier1_generatorgenerate_tier1_from_filesrO   	readlines
startswithr/   rM   r1   strip)r5   r]   r^   
temp_inputtemp_outputlinesactuals          r   run_cases_test!TestGeneratedCases.run_cases_test^   sp   $**D1ZV001U#V../	 2 _55))*D,E,Eu 
 $++,))+EE!H//0KLL		! E!H//0KLLE"I00==		" E"I00==	 -  	)9:3 21 _
 -,s,   A G	.G%A"G78AG7
G"%
G47
Hc                 .    SnSnU R                  X5        g )Nz<
        inst(OP, (--)) {
            spam();
        }
    z
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            spam();
            DISPATCH();
        }
    ru   r5   r]   outputs      r   test_inst_no_args$TestGeneratedCases.test_inst_no_argsz        
 	E*r   c                 .    SnSnU R                  X5        g )NzB
        inst(OP, (value --)) {
            spam();
        }
    a   
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            PyObject *value;
            value = stack_pointer[-1];
            spam();
            stack_pointer += -1;
            DISPATCH();
        }
    rx   ry   s      r   test_inst_one_pop$TestGeneratedCases.test_inst_one_pop        
 	E*r   c                 .    SnSnU R                  X5        g )Nz@
        inst(OP, (-- res)) {
            spam();
        }
    a  
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            PyObject *res;
            spam();
            stack_pointer[0] = res;
            stack_pointer += 1;
            DISPATCH();
        }
    rx   ry   s      r   test_inst_one_push%TestGeneratedCases.test_inst_one_push   r   r   c                 .    SnSnU R                  X5        g )NzF
        inst(OP, (value -- res)) {
            spam();
        }
    a?  
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            PyObject *value;
            PyObject *res;
            value = stack_pointer[-1];
            spam();
            stack_pointer[-1] = res;
            DISPATCH();
        }
    rx   ry   s      r   test_inst_one_push_one_pop-TestGeneratedCases.test_inst_one_push_one_pop   s     
 	E*r   c                 .    SnSnU R                  X5        g )NzL
        inst(OP, (left, right -- res)) {
            spam();
        }
    a  
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            PyObject *right;
            PyObject *left;
            PyObject *res;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            spam();
            stack_pointer[-2] = res;
            stack_pointer += -1;
            DISPATCH();
        }
    rx   ry   s      r   test_binary_op!TestGeneratedCases.test_binary_op        
  	E*r   c                 .    SnSnU R                  X5        g )NzU
        inst(OP, (left, right -- left, result)) {
            spam();
        }
    a  
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            PyObject *right;
            PyObject *left;
            PyObject *result;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            spam();
            stack_pointer[-1] = result;
            DISPATCH();
        }
    rx   ry   s      r   test_overlapTestGeneratedCases.test_overlap   s     
 	E*r   c                 .    SnSnU R                  X5        g )Nz
        inst(OP1, (arg -- rest)) {
        }
        inst(OP3, (arg -- res)) {
            DEOPT_IF(xxx);
            CHECK_EVAL_BREAKER();
        }
        family(OP1, INLINE_CACHE_ENTRIES_OP1) = { OP3 };
    a   
        TARGET(OP1) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP1);
            PREDICTED(OP1);
            PyObject *arg;
            PyObject *rest;
            arg = stack_pointer[-1];
            stack_pointer[-1] = rest;
            DISPATCH();
        }

        TARGET(OP3) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP3);
            static_assert(INLINE_CACHE_ENTRIES_OP1 == 0, "incorrect cache size");
            PyObject *arg;
            PyObject *res;
            arg = stack_pointer[-1];
            DEOPT_IF(xxx, OP1);
            stack_pointer[-1] = res;
            CHECK_EVAL_BREAKER();
            DISPATCH();
        }
    rx   ry   s      r   !test_predictions_and_eval_breaker4TestGeneratedCases.test_predictions_and_eval_breaker   s     6 	E*r   c                 .    SnSnU R                  X5        g )NzK
        inst(OP, (--)) {
            ERROR_IF(cond, label);
        }
    z
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            if (cond) goto label;
            DISPATCH();
        }
    rx   ry   s      r   test_error_if_plain&TestGeneratedCases.test_error_if_plain  r}   r   c                 .    SnSnU R                  X5        g )Nz]
        inst(OP, (--)) {
            ERROR_IF(cond, label);  // Comment is ok
        }
    z
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            if (cond) goto label;
            // Comment is ok
            DISPATCH();
        }
    rx   ry   s      r    test_error_if_plain_with_comment3TestGeneratedCases.test_error_if_plain_with_comment/  s     
	 	E*r   c                 .    SnSnU R                  X5        g )Nz[
        inst(OP, (left, right -- res)) {
            ERROR_IF(cond, label);
        }
    a  
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            PyObject *right;
            PyObject *left;
            PyObject *res;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            if (cond) goto pop_2_label;
            stack_pointer[-2] = res;
            stack_pointer += -1;
            DISPATCH();
        }
    rx   ry   s      r   test_error_if_pop$TestGeneratedCases.test_error_if_popA  r   r   c                 .    SnSnU R                  X5        g )NzB
        inst(OP, (counter/1, extra/2, value --)) {
        }
    a  
        TARGET(OP) {
            _Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr;
            (void)this_instr;
            next_instr += 4;
            INSTRUCTION_STATS(OP);
            PyObject *value;
            value = stack_pointer[-1];
            uint16_t counter = read_u16(&this_instr[1].cache);
            (void)counter;
            uint32_t extra = read_u32(&this_instr[2].cache);
            (void)extra;
            stack_pointer += -1;
            DISPATCH();
        }
    rx   ry   s      r   test_cache_effect$TestGeneratedCases.test_cache_effectY  s       	E*r   c                 .    SnSnU R                  X5        g )NzD
        inst(OP, (--)) {
            goto somewhere;
        }
    z
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            goto somewhere;
        }
    rx   ry   s      r   test_suppress_dispatch)TestGeneratedCases.test_suppress_dispatchp  s     
 	E*r   c                 .    SnSnU R                  X5        g )Na  
        inst(OP1, (counter/1, left, right -- left, right)) {
            op1(left, right);
        }
        op(OP2, (extra/2, arg2, left, right -- res)) {
            res = op2(arg2, left, right);
        }
        macro(OP) = OP1 + cache/2 + OP2;
        inst(OP3, (unused/5, arg2, left, right -- res)) {
            res = op3(arg2, left, right);
        }
        family(OP, INLINE_CACHE_ENTRIES_OP) = { OP3 };
    a"  
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 6;
            INSTRUCTION_STATS(OP);
            PREDICTED(OP);
            _Py_CODEUNIT *this_instr = next_instr - 6;
            (void)this_instr;
            PyObject *right;
            PyObject *left;
            PyObject *arg2;
            PyObject *res;
            // _OP1
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            {
                uint16_t counter = read_u16(&this_instr[1].cache);
                (void)counter;
                op1(left, right);
            }
            /* Skip 2 cache entries */
            // OP2
            arg2 = stack_pointer[-3];
            {
                uint32_t extra = read_u32(&this_instr[4].cache);
                (void)extra;
                res = op2(arg2, left, right);
            }
            stack_pointer[-3] = res;
            stack_pointer += -2;
            DISPATCH();
        }

        TARGET(OP1) {
            _Py_CODEUNIT *this_instr = frame->instr_ptr = next_instr;
            (void)this_instr;
            next_instr += 2;
            INSTRUCTION_STATS(OP1);
            PyObject *right;
            PyObject *left;
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            uint16_t counter = read_u16(&this_instr[1].cache);
            (void)counter;
            op1(left, right);
            DISPATCH();
        }

        TARGET(OP3) {
            frame->instr_ptr = next_instr;
            next_instr += 6;
            INSTRUCTION_STATS(OP3);
            static_assert(INLINE_CACHE_ENTRIES_OP == 5, "incorrect cache size");
            PyObject *right;
            PyObject *left;
            PyObject *arg2;
            PyObject *res;
            /* Skip 5 cache entries */
            right = stack_pointer[-1];
            left = stack_pointer[-2];
            arg2 = stack_pointer[-3];
            res = op3(arg2, left, right);
            stack_pointer[-3] = res;
            stack_pointer += -2;
            DISPATCH();
        }
    rx   ry   s      r   test_macro_instruction)TestGeneratedCases.test_macro_instruction  s"    BF 	E*r   c                 .    SnSnU R                  X5        g )NzO
        inst(OP, (unused/1, unused/2 --)) {
            body();
        }
    a  
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 4;
            INSTRUCTION_STATS(OP);
            /* Skip 1 cache entry */
            /* Skip 2 cache entries */
            body();
            DISPATCH();
        }
    rx   ry   s      r   test_unused_caches%TestGeneratedCases.test_unused_caches  s     

 	E*r   c                 .    SnSnU R                  X5        g )Nz]
        pseudo(OP) = {
            OP1,
        };

        inst(OP1, (--)) {
        }
    
        TARGET(OP1) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP1);
            DISPATCH();
        }
    rx   ry   s      r    test_pseudo_instruction_no_flags3TestGeneratedCases.test_pseudo_instruction_no_flags        	E*r   c                 .    SnSnU R                  X5        g )Nzr
        pseudo(OP, (HAS_ARG, HAS_JUMP)) = {
            OP1,
        };

        inst(OP1, (--)) {
        }
    r   rx   ry   s      r   "test_pseudo_instruction_with_flags5TestGeneratedCases.test_pseudo_instruction_with_flags  r   r   c                 .    SnSnU R                  X5        g )NzZ
        inst(OP, (below, values[oparg*2], above --)) {
            spam();
        }
    a  
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            PyObject *above;
            PyObject **values;
            PyObject *below;
            above = stack_pointer[-1];
            values = &stack_pointer[-1 - oparg*2];
            below = stack_pointer[-2 - oparg*2];
            spam();
            stack_pointer += -2 - oparg*2;
            DISPATCH();
        }
    rx   ry   s      r   test_array_input#TestGeneratedCases.test_array_input  r   r   c                 .    SnSnU R                  X5        g )Nzv
        inst(OP, (unused, unused -- below, values[oparg*3], above)) {
            spam(values, oparg);
        }
    a  
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            PyObject *below;
            PyObject **values;
            PyObject *above;
            values = &stack_pointer[-1];
            spam(values, oparg);
            stack_pointer[-2] = below;
            stack_pointer[-1 + oparg*3] = above;
            stack_pointer += oparg*3;
            DISPATCH();
        }
    rx   ry   s      r   test_array_output$TestGeneratedCases.test_array_output$  r   r   c                 .    SnSnU R                  X5        g )Nzl
        inst(OP, (values[oparg] -- values[oparg], above)) {
            spam(values, oparg);
        }
    aw  
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            PyObject **values;
            PyObject *above;
            values = &stack_pointer[-oparg];
            spam(values, oparg);
            stack_pointer[0] = above;
            stack_pointer += 1;
            DISPATCH();
        }
    rx   ry   s      r   test_array_input_output*TestGeneratedCases.test_array_input_output<       
 	E*r   c                 .    SnSnU R                  X5        g )Nzj
        inst(OP, (extra, values[oparg] --)) {
            ERROR_IF(oparg == 0, somewhere);
        }
    a  
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            PyObject **values;
            PyObject *extra;
            values = &stack_pointer[-oparg];
            extra = stack_pointer[-1 - oparg];
            if (oparg == 0) { stack_pointer += -1 - oparg; goto somewhere; }
            stack_pointer += -1 - oparg;
            DISPATCH();
        }
    rx   ry   s      r   test_array_error_if&TestGeneratedCases.test_array_error_ifR  r   r   c                 .    SnSnU R                  X5        g )Nz
        inst(OP, (aa, input if ((oparg & 1) == 1), cc -- xx, output if (oparg & 2), zz)) {
            output = spam(oparg, input);
        }
    a  
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            PyObject *cc;
            PyObject *input = NULL;
            PyObject *aa;
            PyObject *xx;
            PyObject *output = NULL;
            PyObject *zz;
            cc = stack_pointer[-1];
            if ((oparg & 1) == 1) { input = stack_pointer[-1 - (((oparg & 1) == 1) ? 1 : 0)]; }
            aa = stack_pointer[-2 - (((oparg & 1) == 1) ? 1 : 0)];
            output = spam(oparg, input);
            stack_pointer[-2 - (((oparg & 1) == 1) ? 1 : 0)] = xx;
            if (oparg & 2) stack_pointer[-1 - (((oparg & 1) == 1) ? 1 : 0)] = output;
            stack_pointer[-1 - (((oparg & 1) == 1) ? 1 : 0) + ((oparg & 2) ? 1 : 0)] = zz;
            stack_pointer += -(((oparg & 1) == 1) ? 1 : 0) + ((oparg & 2) ? 1 : 0);
            DISPATCH();
        }
    rx   ry   s      r   test_cond_effect#TestGeneratedCases.test_cond_effecth  s     
, 	E*r   c                 .    SnSnU R                  X5        g )Nz
        op(A, (left, middle, right --)) {
            # Body of A
        }
        op(B, (-- deep, extra if (oparg), res)) {
            # Body of B
        }
        macro(M) = A + B;
    a$  
        TARGET(M) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(M);
            PyObject *right;
            PyObject *middle;
            PyObject *left;
            PyObject *deep;
            PyObject *extra = NULL;
            PyObject *res;
            // A
            right = stack_pointer[-1];
            middle = stack_pointer[-2];
            left = stack_pointer[-3];
            {
                # Body of A
            }
            // B
            {
                # Body of B
            }
            stack_pointer[-3] = deep;
            if (oparg) stack_pointer[-2] = extra;
            stack_pointer[-2 + ((oparg) ? 1 : 0)] = res;
            stack_pointer += -1 + ((oparg) ? 1 : 0);
            DISPATCH();
        }
    rx   ry   s      r   test_macro_cond_effect)TestGeneratedCases.test_macro_cond_effect  s     : 	E*r   c                 .    SnSnU R                  X5        g )Nz
        op(A, (-- val1)) {
            val1 = spam();
        }
        op(B, (-- val2)) {
            val2 = spam();
        }
        macro(M) = A + B;
        a  
        TARGET(M) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(M);
            PyObject *val1;
            PyObject *val2;
            // A
            {
                val1 = spam();
            }
            // B
            {
                val2 = spam();
            }
            stack_pointer[0] = val1;
            stack_pointer[1] = val2;
            stack_pointer += 2;
            DISPATCH();
        }
        rx   ry   s      r   test_macro_push_push'TestGeneratedCases.test_macro_push_push  s     * 	E*r   c                 .    SnSnU R                  X5        g )Nz
        inst(OP, (--)) {
            spam();
        }
        override inst(OP, (--)) {
            ham();
        }
        
        TARGET(OP) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(OP);
            ham();
            DISPATCH();
        }
        rx   ry   s      r   test_override_inst%TestGeneratedCases.test_override_inst  s      	E*r   c                 .    SnSnU R                  X5        g )Nz
        op(OP, (--)) {
            spam();
        }
        macro(M) = OP;
        override op(OP, (--)) {
            ham();
        }
        z
        TARGET(M) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(M);
            ham();
            DISPATCH();
        }
        rx   ry   s      r   test_override_op#TestGeneratedCases.test_override_op  s      	E*r   c                 .    SnSnU R                  X5        g )NzD
        pure inst(OP, (--)) {
            ham();
        }
        r   rx   ry   s      r   test_annotated_inst&TestGeneratedCases.test_annotated_inst  s     
 	E*r   c                 T    SnSnU R                  X5        SnU R                  X5        g )NzZ
        pure op(OP, (--)) {
            spam();
        }
        macro(M) = OP;
        z
        TARGET(M) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(M);
            spam();
            DISPATCH();
        }
        zp
        pure register specializing op(OP, (--)) {
            spam();
        }
        macro(M) = OP;
        rx   ry   s      r   test_annotated_op$TestGeneratedCases.test_annotated_op
  s7     	E* 	E*r   c                     SnSnU R                  [        5         U R                  X5        S S S 5        g ! , (       d  f       g = f)Nzi
        pure op(OP, (arg1 -- out)) {
            DEOPT_IF(1);
            EXIT_IF(1);
        }
        r(   )assertRaises	Exceptionru   ry   s      r   test_deopt_and_exit&TestGeneratedCases.test_deopt_and_exit%  s8     y). *))s	   5
Ac                 .    SnSnU R                  X5        g )Na	  
        op(FIRST, (x, y -- a, b)) {
            a = x;
            b = y;
        }

        op(SECOND, (a, b -- a, b)) {
        }

        op(THIRD, (j, k --)) {
            ERROR_IF(cond, error);
        }

        macro(TEST) = FIRST + SECOND + THIRD;
        a  
        TARGET(TEST) {
            frame->instr_ptr = next_instr;
            next_instr += 1;
            INSTRUCTION_STATS(TEST);
            PyObject *y;
            PyObject *x;
            PyObject *a;
            PyObject *b;
            PyObject *k;
            PyObject *j;
            // FIRST
            y = stack_pointer[-1];
            x = stack_pointer[-2];
            {
                a = x;
                b = y;
            }
            // SECOND
            {
            }
            // THIRD
            k = b;
            j = a;
            {
                if (cond) goto pop_2_error;
            }
            stack_pointer += -2;
            DISPATCH();
        }
        rx   ry   s      r   test_pop_on_error_peeks*TestGeneratedCases.test_pop_on_error_peeks0  s     > 	E*r   )rI   rL   rR   rN   rP   rO   rQ   returnN)'r<   r=   r>   r?   rH   rY   strru   r{   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r@   __classcell__rT   s   @r   rB   rB   D   s    	R;C ;3 ;8+"+(+(+*+0+.%+N+"+$+0+.+ Q+f+&+&+&+0+0+,+,+<'+R+B+(+*+"+6	/0+ 0+r   rB   c                   j   ^  \ rS rSrSU 4S jjrSU 4S jjrS\S\S\4S jrS rS	 r	S
 r
S rSrU =r$ )TestGeneratedAbstractCasesib  c                 ~  > [         TU ]  5         S U l        [        R                  " 5       U l        [        R                  R                  U R
                  S5      U l	        [        R                  R                  U R
                  S5      U l
        [        R                  R                  U R
                  S5      U l        g )NrE   z
input2.txtrF   )rG   rH   rI   rJ   rK   rL   r
   r   rM   rN   temp_input2_filenamerO   rS   s    r   rH    TestGeneratedAbstractCases.setUpc  st     ++-#%77<<{#K $&GGLL$M!$&GGLL$M!r   c                    > U R                   U R                  U R                  4 H  n [        R                  " U5        M     [
        TU ]  5         g !    M2  = frW   )rN   r   rO   r
   rX   rG   rY   rZ   s     r   rY   #TestGeneratedAbstractCases.tearDownl  sR    $$%%%%
H
		(#
 	s   AAr]   input2r^   c                 D   [        U R                  S5       nUR                  [        R                  5        UR                  U5        UR                  [        R
                  5        UR                  5         S S S 5        [        U R                  S5       nUR                  [        R                  5        UR                  U5        UR                  [        R
                  5        UR                  5         S S S 5        [        5          [        R                  " U R                  U R                  /U R                  5        S S S 5        [        U R                  5       nUR                  5       nU(       aL  US   R                  S5      (       a3  UR                  S5        U(       a  US   R                  S5      (       a  M3  U(       aL  US   R                  S5      (       a3  UR                  S5        U(       a  US   R                  S5      (       a  M3  S S S 5        SR                  W5      nU R!                  UR#                  5       UR#                  5       5        g ! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       GNG= f! , (       d  f       N= f)Nr`   r   ra   rd   re   r(   )rf   rN   rg   rh   ri   rj   rk   r   r"   optimizer_generator"generate_tier2_abstract_from_filesrO   rn   ro   r/   rM   r1   rp   )r5   r]   r   r^   rq   rr   rs   rt   s           r   ru   )TestGeneratedAbstractCases.run_cases_testx  s   $**D1ZV001U#V../	 2 $++T2jV001V$V../	 3 _BB))4+D+DE))  $++,))+EE!H//0KLL		! E!H//0KLLE"I00==		" E"I00==	 - )9:3 21 32 _ -,s9   A IA I-8I?A"J AJ
I*-
I<?
J
Jc                 4    SnSnSnU R                  XU5        g )NzC
        pure op(OP, (--)) {
            spam();
        }
        zC
        pure op(OP, (--)) {
            eggs();
        }
        zM
        case OP: {
            eggs();
            break;
        }
        rx   r5   r]   r   rz   s       r   test_overridden_abstract3TestGeneratedAbstractCases.test_overridden_abstract  s)    

 	E62r   c                 4    SnSnSnU R                  XU5        g )Nz
        pure op(OP, (arg1 -- out)) {
            spam();
        }
        op(OP2, (arg1 -- out)) {
            eggs();
        }
        zG
        op(OP, (arg1 -- out)) {
            eggs();
        }
        a  
        case OP: {
            _Py_UopsSymbol *arg1;
            _Py_UopsSymbol *out;
            arg1 = stack_pointer[-1];
            eggs();
            stack_pointer[-1] = out;
            break;
        }

        case OP2: {
            _Py_UopsSymbol *out;
            out = sym_new_not_null(ctx);
            if (out == NULL) goto out_of_space;
            stack_pointer[-1] = out;
            break;
        }
       rx   r   s       r   test_overridden_abstract_args8TestGeneratedAbstractCases.test_overridden_abstract_args  s)    
$ 	E62r   c                 4    SnSnSnU R                  XU5        g )Nz~
        pure op(OP, (arg1 -- out)) {
            spam();
        }

        pure op(OP2, (arg1 -- out)) {
        }

        z9
        pure op(OP2, (arg1 -- out)) {
        }
        a  
        case OP: {
            _Py_UopsSymbol *out;
            out = sym_new_not_null(ctx);
            if (out == NULL) goto out_of_space;
            stack_pointer[-1] = out;
            break;
        }

        case OP2: {
            _Py_UopsSymbol *arg1;
            _Py_UopsSymbol *out;
            arg1 = stack_pointer[-1];
            stack_pointer[-1] = out;
            break;
        }
        rx   r   s       r   test_no_overridden_case2TestGeneratedAbstractCases.test_no_overridden_case  s)    " 	E62r   c                     SnSnSnU R                  [        S5         U R                  XU5        S S S 5        g ! , (       d  f       g = f)NzL
        pure op(OP, (arg1 -- out)) {
            spam();
        }
        z;
        pure op(OTHER, (arg1 -- out)) {
        }
        z	
        zAll abstract uops)assertRaisesRegexAssertionErrorru   r   s       r   test_missing_override_failure8TestGeneratedAbstractCases.test_missing_override_failure  sE    
##N4GHv6 IHHs	   9
A)rI   rL   r   rN   rO   r   )r<   r=   r>   r?   rH   rY   r   ru   r   r   r   r   r@   r   r   s   @r   r   r   b  sC    N
;C ; ; ;83& 3D3B7 7r   r   __main__)r   r
   r   rJ   r   testr   r   r   skip_if_missingimports_under_toolanalyzerr   rh   r6   r   rl   r   r"   TestCaser$   rB   r   r<   mainr!   r   r   <module>r     s     	 
    
       , -""#45" 6)S(## S,\+** \+|U7!2!2 U7p zMMO w 65s   C
C