U
    -e                     @   s   d dl Z d dlZd dlZd dlmZmZmZmZmZm	Z	m
Z
 d dlmZ edZedZejdd dkZG dd	 d	eZed
kre  dS )    N)Constant	FloatType
DoubleTypeLiteralStructTypeIntType	ArrayTypeHalfType)TestCase         )      c                   @   s@   e Zd Zdd Zdd Zeeddd Zdd	 Z	d
d Z
dS )TestValueReprc                    s8    fdd}|t jd |tdd |tdd d S )Nc                    s    t t | } t|| d S N)r   r   assertEqualstrvalexpectedcself ^/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/llvmlite/tests/test_valuerepr.py
check_repr   s    z2TestValueRepr.test_double_repr.<locals>.check_reprzdouble 0x400921fb54442d18infzdouble 0x7ff0000000000000-infzdouble 0xfff0000000000000mathpifloatr   r   r   r   r   test_double_repr   s    zTestValueRepr.test_double_reprc                    s8    fdd}|t jd |tdd |tdd d S )Nc                    s    t t | } t|| d S r   )r   r   r   r   r   r   r   r   r      s    z1TestValueRepr.test_float_repr.<locals>.check_reprzfloat 0x400921fb60000000r   zfloat 0x7ff0000000000000r   zfloat 0xfff0000000000000r   r"   r   r   r   test_float_repr   s    zTestValueRepr.test_float_reprz
py36+ onlyc                    s8    fdd}|t jd |tdd |tdd d S )Nc                    s    t t | } t|| d S r   )r   r   r   r   r   r   r   r   r   &   s    z0TestValueRepr.test_half_repr.<locals>.check_reprzhalf 0x4009200000000000r   zhalf 0x7ff0000000000000r   zhalf 0xfff0000000000000r   r"   r   r   r   test_half_repr$   s    zTestValueRepr.test_half_reprc                 C   s:   t ttg}t|ttdttdf}| t|d d S )Nd   i  z{i8, i16} {i8 100, i16 1000})r   int8int16r   r   r   )r   tpr   r   r   r   test_struct_repr-   s    zTestValueRepr.test_struct_reprc                 C   sT   t td}dd dD }t||}| t|d t|td}| t|d d S )Nr   c                 S   s   g | ]}t t|qS r   )r   r'   ).0xr   r   r   
<listcomp>4   s     z1TestValueRepr.test_array_repr.<locals>.<listcomp>)   
   iz[3 x i8] [i8 5, i8 10, i8 -15]s   z[3 x i8] c"\01\02\03")r   r'   r   r   r   	bytearray)r   r)   valuesr   r   r   r   test_array_repr2   s    

zTestValueRepr.test_array_reprN)__name__
__module____qualname__r#   r$   unittestZ
skipUnlessPY36_OR_LATERr%   r*   r2   r   r   r   r   r      s   

r   __main__)r   sysr6   Zllvmlite.irr   r   r   r   r   r   r   Zllvmlite.testsr	   r'   r(   version_infor7   r   r3   mainr   r   r   r   <module>   s   $)