2015-07-03 00:35:35 +08:00
|
|
|
# RUN: %python -m artiq.compiler.testbench.inferencer %s >%t
|
2015-06-06 21:58:23 +08:00
|
|
|
# RUN: OutputCheck %s --file-to-check=%t
|
|
|
|
|
|
|
|
a = 1
|
|
|
|
# CHECK-L: a:int(width='a)
|
|
|
|
|
|
|
|
b = a
|
|
|
|
# CHECK-L: b:int(width='a)
|
|
|
|
|
|
|
|
c = True
|
|
|
|
# CHECK-L: c:bool
|
|
|
|
|
|
|
|
d = False
|
|
|
|
# CHECK-L: d:bool
|
|
|
|
|
|
|
|
e = None
|
|
|
|
# CHECK-L: e:NoneType
|
|
|
|
|
|
|
|
f = 1.0
|
|
|
|
# CHECK-L: f:float
|
|
|
|
|
|
|
|
g = []
|
|
|
|
# CHECK-L: g:list(elt='b)
|
|
|
|
|
|
|
|
h = [1]
|
|
|
|
# CHECK-L: h:list(elt=int(width='c))
|
2015-06-06 23:05:06 +08:00
|
|
|
|
|
|
|
i = []
|
|
|
|
i[0] = 1
|
|
|
|
# CHECK-L: i:list(elt=int(width='d))
|
|
|
|
|
|
|
|
j = []
|
|
|
|
j += [1.0]
|
|
|
|
# CHECK-L: j:list(elt=float)
|
2015-06-11 08:22:20 +08:00
|
|
|
|
|
|
|
1 if a else 2
|
|
|
|
# CHECK-L: 1:int(width='f) if a:int(width='a) else 2:int(width='f):int(width='f)
|
|
|
|
|
|
|
|
True and False
|
|
|
|
# CHECK-L: True:bool and False:bool:bool
|
2015-06-11 09:20:33 +08:00
|
|
|
|
|
|
|
1 and 0
|
|
|
|
# CHECK-L: 1:int(width='g) and 0:int(width='g):int(width='g)
|
2015-06-12 13:59:41 +08:00
|
|
|
|
|
|
|
~1
|
|
|
|
# CHECK-L: 1:int(width='h):int(width='h)
|
|
|
|
|
|
|
|
not 1
|
|
|
|
# CHECK-L: 1:int(width='i):bool
|
2015-06-15 13:40:37 +08:00
|
|
|
|
|
|
|
[x for x in [1]]
|
|
|
|
# CHECK-L: [x:int(width='j) for x:int(width='j) in [1:int(width='j)]:list(elt=int(width='j))]:list(elt=int(width='j))
|
2015-06-15 16:30:50 +08:00
|
|
|
|
|
|
|
lambda x, y=1: x
|
2015-06-15 21:00:19 +08:00
|
|
|
# CHECK-L: lambda x:'k, y:int(width='l)=1:int(width='l): x:'k:(x:'k, ?y:int(width='l))->'k
|
2015-06-15 16:30:50 +08:00
|
|
|
|