B
      ›\  ã               @   sf   d dl mZmZmZ d dlZd dlZd dlmZm	Z	 d dlm
Z G dd„ dejƒZedkrbe ¡  dS )é    )Úprint_functionÚabsolute_importÚdivisionN)ÚnjitÚtypes)Úunittest_supportc               @   s   e Zd ZdZdd„ ZdS )Ú
TestMulti3a¢  
    This test is only relevant for 32-bit architectures.

    Test __multi3 implementation in _helperlib.c.
    The symbol defines a i128 multiplication.
    It is necessary for working around an issue in LLVM (see issue #969).
    The symbol does not exist in 32-bit platform, and should not be used by
    LLVM.  However, optimization passes will create i65 multiplication that
    is then lowered to __multi3.
    c             C   s|   t dƒdd„ ƒ}dddddd	d
ddddg}x"tdƒD ]}| t dd¡¡ q4W dd„ }x |D ]}|  ||ƒ||ƒ¡ q\W d S )Nz(int64,)c             S   s"   d}xt | ƒD ]}||7 }qW |S )Nr   )Úrange)ÚxZresÚi© r   ú6lib/python3.7/site-packages/numba/tests/test_multi3.pyÚfunc   s    z$TestMulti3.test_multi3.<locals>.funcéÿÿÿÿr   é   é   é   é   l   þÿ l   ÿÿ l        l   ïMWž	lüÿÿÿïMWž	iô  c             S   s    | dkrdS | | d  d d@ S )Nr   r   é   l   ÿÿÿÿ r   )r
   r   r   r   Úexpected#   s     z(TestMulti3.test_multi3.<locals>.expected)r   r	   ÚappendÚrandomZrandintZassertEqual)Úselfr   Zx_casesÚ_r   r
   r   r   r   Útest_multi3   s    
zTestMulti3.test_multi3N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   
   s   
r   Ú__main__)Z
__future__r   r   r   r   ZnumpyZnpZnumbar   r   r   ZunittestZTestCaser   r   Úmainr   r   r   r   Ú<module>   s   !