2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-27 20:28:25 +08:00
artiq/lit-test/test/inferencer/coerce.py

42 lines
1.4 KiB
Python
Raw Normal View History

# RUN: %python -m artiq.compiler.testbench.inferencer %s >%t
2015-06-14 17:07:13 +08:00
# RUN: OutputCheck %s --file-to-check=%t
1 | 2
# CHECK-L: 1:int(width='a):int(width='b) | 2:int(width='c):int(width='b):int(width='b)
1 + 2
# CHECK-L: 1:int(width='d):int(width='e) + 2:int(width='f):int(width='e):int(width='e)
(1,) + (2.0,)
# CHECK-L: (1:int(width='g),):(int(width='g),) + (2.0:float,):(float,):(int(width='g), float)
[1] + [2]
# CHECK-L: [1:int(width='h)]:list(elt=int(width='h)) + [2:int(width='h)]:list(elt=int(width='h)):list(elt=int(width='h))
1 * 2
# CHECK-L: 1:int(width='i):int(width='j) * 2:int(width='k):int(width='j):int(width='j)
[1] * 2
# CHECK-L: [1:int(width='l)]:list(elt=int(width='l)) * 2:int(width='m):list(elt=int(width='l))
2015-07-21 19:05:07 +08:00
1 // 2
# CHECK-L: 1:int(width='n):int(width='o) // 2:int(width='p):int(width='o):int(width='o)
2015-06-14 17:07:13 +08:00
1 + 1.0
# CHECK-L: 1:int(width='q):float + 1.0:float:float
a = []; a += [1]
# CHECK-L: a:list(elt=int(width='r)) = []:list(elt=int(width='r)); a:list(elt=int(width='r)) += [1:int(width='r)]:list(elt=int(width='r))
2015-06-15 03:48:04 +08:00
[] is [1]
# CHECK-L: []:list(elt=int(width='s)) is [1:int(width='s)]:list(elt=int(width='s)):bool
1 in [1]
# CHECK-L: 1:int(width='t) in [1:int(width='t)]:list(elt=int(width='t)):bool
[] < [1]
# CHECK-L: []:list(elt=int(width='u)) < [1:int(width='u)]:list(elt=int(width='u)):bool
1.0 < 1
# CHECK-L: 1.0:float < 1:int(width='v):float:bool