Skip to content

Commit 0d38f20

Browse files
committed
init
1 parent 0eb7292 commit 0d38f20

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

mypyc/test-data/irbuild-statements.test

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,3 +1052,74 @@ def _(arg): pass
10521052
def _(arg): pass
10531053
[out]
10541054
main:2: error: Duplicate definition of "_" not supported by mypyc
1055+
1056+
[case testXXX]
1057+
X = tuple[str, ...]
1058+
1059+
def f() -> tuple[str, ...]:
1060+
return X(str(x) for x in range(5))
1061+
1062+
def f2() -> tuple[str, ...]:
1063+
return tuple(str(x) for x in range(5))
1064+
[out]
1065+
def f():
1066+
r0 :: list
1067+
r1 :: short_int
1068+
x :: int
1069+
r2 :: bit
1070+
r3 :: str
1071+
r4 :: i32
1072+
r5 :: bit
1073+
r6 :: short_int
1074+
r7 :: object
1075+
r8 :: tuple
1076+
L0:
1077+
r0 = PyList_New(0)
1078+
r1 = 0
1079+
x = r1
1080+
L1:
1081+
r2 = int_lt r1, 10
1082+
if r2 goto L2 else goto L4 :: bool
1083+
L2:
1084+
x = r1
1085+
r3 = CPyTagged_Str(x)
1086+
r4 = PyList_Append(r0, r3)
1087+
r5 = r4 >= 0 :: signed
1088+
L3:
1089+
r6 = r1 + 2
1090+
r1 = r6
1091+
goto L1
1092+
L4:
1093+
r7 = PyObject_GetIter(r0)
1094+
r8 = PySequence_Tuple(r7)
1095+
return r8
1096+
def f2():
1097+
r0 :: list
1098+
r1 :: short_int
1099+
x :: int
1100+
r2 :: bit
1101+
r3 :: str
1102+
r4 :: i32
1103+
r5 :: bit
1104+
r6 :: short_int
1105+
r7 :: tuple
1106+
L0:
1107+
r0 = PyList_New(0)
1108+
r1 = 0
1109+
x = r1
1110+
L1:
1111+
r2 = int_lt r1, 10
1112+
if r2 goto L2 else goto L4 :: bool
1113+
L2:
1114+
x = r1
1115+
r3 = CPyTagged_Str(x)
1116+
r4 = PyList_Append(r0, r3)
1117+
r5 = r4 >= 0 :: signed
1118+
L3:
1119+
r6 = r1 + 2
1120+
r1 = r6
1121+
goto L1
1122+
L4:
1123+
r7 = PyList_AsTuple(r0)
1124+
return r7
1125+

0 commit comments

Comments
 (0)