Skip to content

Commit 70c8cd5

Browse files
author
Johan Dahlin
committed
Add an IR test for in tuple/list literal
1 parent c4ee283 commit 70c8cd5

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

mypyc/test-data/irbuild-tuple.test

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,38 @@ L2:
193193
r4 = CPySequenceTuple_GetItem(nt, r3)
194194
r5 = unbox(int, r4)
195195
return r5
196+
[case testTupleOperatorIn]
197+
def f(i: int) -> bool:
198+
return i in [1, 2, 3]
199+
[out]
200+
def f(i):
201+
i :: int
202+
r0, r1 :: bool
203+
r2 :: short_int
204+
r3 :: bool
205+
r4 :: short_int
206+
r5 :: bool
207+
r6 :: short_int
208+
r7 :: bool
209+
L0:
210+
r2 = 1
211+
r3 = i == r2 :: int
212+
if r3 goto L1 else goto L2 :: bool
213+
L1:
214+
r1 = r3
215+
goto L3
216+
L2:
217+
r4 = 2
218+
r5 = i == r4 :: int
219+
r1 = r5
220+
L3:
221+
if r1 goto L4 else goto L5 :: bool
222+
L4:
223+
r0 = r1
224+
goto L6
225+
L5:
226+
r6 = 3
227+
r7 = i == r6 :: int
228+
r0 = r7
229+
L6:
230+
return r0

0 commit comments

Comments
 (0)