U
    9%e                     @   st   d dl Z d dlmZ d dlmZmZ d dlmZ d dlm	Z	 G dd de j
ZG dd	 d	e j
Zed
krpe   dS )    N)njit)PythonFunctionDescriptordefault_mangler)run_frontendmangle_abi_tagc                   @   s   e Zd Zdd ZdS )
TestModulec                 C   sN   d}d}d}t ||d}t||d}t|| t|d }| |dd dS )	z Test of trying to run a compiled function
        where the module from which the function is being compiled
        doesn't exist in the namespace.
        ztest.pyZ	mypackagez
def f(x):
    return x
)__file____name__execf   N)dictcompiler   r   assertEqual)selffilenamenamecodeZobjscompiledZ
compiled_f r   X/var/www/html/Darija-Ai-API/env/lib/python3.8/site-packages/numba/tests/test_funcdesc.pytest_module_not_in_namespace   s    
z'TestModule.test_module_not_in_namespaceN)r
   
__module____qualname__r   r   r   r   r   r   
   s   r   c                   @   s   e Zd Zdd ZdS )TestFuncDescMangledNamec              
   C   sh   dd }t |}i }d}d}t}d}d}d}	tj||||||||	d}
| dd	d
 |	D |
j dS )zQ
        This is a minimal test for the abi-tags support in the mangler.
        c                   S   s   d S )Nr   r   r   r   r   udt$   s    z;TestFuncDescMangledName.test_mangling_abi_tags.<locals>.udtNr   F)Z	ShrubberyZHerring)abi_tags c                 S   s   g | ]}t |qS r   r   ).0xr   r   r   
<listcomp>8   s     zBTestFuncDescMangledName.test_mangling_abi_tags.<locals>.<listcomp>)r   r   r   Zfrom_specialized_functionZassertInjoinZmangled_name)r   r   Zfunc_irtypemaprestypeZ	calltypesZmanglerinlineZnoaliasr   fdr   r   r   test_mangling_abi_tags    s,          z.TestFuncDescMangledName.test_mangling_abi_tagsN)r
   r   r   r'   r   r   r   r   r      s   r   __main__)ZunittestZnumbar   Znumba.core.funcdescr   r   Znumba.core.compilerr   Znumba.core.itanium_manglerr   ZTestCaser   r   r
   mainr   r   r   r   <module>   s   