U
    iâËd¢  ã                   @   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   úR/home/sam/Atlas/atlas_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   