o
    i#                     @   sd   d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ G dd deZ	e
dkr0e   dS dS )    N)jit)utils)TestCasec                   @   s$   e Zd ZdZdZdd Zdd ZdS )TestExtendedArgz3
    Test support for the EXTENDED_ARG opcode.
       c                 C   s   dd }t |jj}|jj}d}|d| j  d }tjdkr!d}nd}t|t	j
d	}|d
| | ||d
  |d
d
< |jjt||d|_|S )zW
        Get a function with a EXTENDED_ARG opcode before a LOAD_CONST opcode.
        c                  S   s   d} | S )N    )xr   r   [/home/ubuntu/transcripts/venv/lib/python3.10/site-packages/numba/tests/test_extended_arg.pyf   s   z6TestExtendedArg.get_extended_arg_load_const.<locals>.fz<BB)N)*   )         r      N)co_code	co_consts)	bytearray__code__r   r   bytecode_lenr   	PYVERSIONstructpackdisEXTENDED_ARGreplacebytes)selfr   bconstsbytecode_formatoffsetpacked_extend_argr   r   r
   get_extended_arg_load_const   s   
$z+TestExtendedArg.get_extended_arg_load_constc                 C   sL   |   }| t|jj| j | | d tdd|}| | d d S )Nr   T)nopython)r#   assertGreaterlenr   r   r   assertPreciseEqualr   )r   pyfunccfuncr   r   r
   test_extended_arg_load_const)   s
   z,TestExtendedArg.test_extended_arg_load_constN)__name__
__module____qualname____doc__r   r#   r*   r   r   r   r
   r      s
    r   __main__)unittestr   r   numbar   
numba.corer   numba.tests.supportr   r   r+   mainr   r   r   r
   <module>   s    '