-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Expand file tree
/
Copy pathirbuild-lists.test
More file actions
974 lines (921 loc) · 17.1 KB
/
irbuild-lists.test
File metadata and controls
974 lines (921 loc) · 17.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
[case testListGet]
from typing import List
def f(x: List[int]) -> int:
return x[0]
[out]
def f(x):
x :: list
r0 :: object
r1 :: int
L0:
r0 = CPyList_GetItemShort(x, 0)
r1 = unbox(int, r0)
return r1
[case testListOfListGet]
from typing import List
def f(x: List[List[int]]) -> List[int]:
return x[0]
[out]
def f(x):
x :: list
r0 :: object
r1 :: list
L0:
r0 = CPyList_GetItemShort(x, 0)
r1 = cast(list, r0)
return r1
[case testListOfListGet2]
from typing import List
def f(x: List[List[int]]) -> int:
return x[0][1]
[out]
def f(x):
x :: list
r0 :: object
r1 :: list
r2 :: object
r3 :: int
L0:
r0 = CPyList_GetItemShortBorrow(x, 0)
r1 = borrow cast(list, r0)
r2 = CPyList_GetItemShort(r1, 2)
r3 = unbox(int, r2)
keep_alive x, r0
return r3
[case testListSet]
from typing import List
def f(x: List[int]) -> None:
x[0] = 1
[out]
def f(x):
x :: list
r0 :: object
r1 :: bit
L0:
r0 = object 1
r1 = CPyList_SetItem(x, 0, r0)
return 1
[case testNewListEmpty]
from typing import List
def f() -> None:
x = [] # type: List[int]
[out]
def f():
r0, x :: list
L0:
r0 = PyList_New(0)
x = r0
return 1
[case testNewListEmptyViaFunc]
from typing import List
def f() -> None:
x: List[int] = list()
[out]
def f():
r0, x :: list
L0:
r0 = PyList_New(0)
x = r0
return 1
[case testNewListEmptyViaAlias]
from typing import List
ListAlias = list
def f() -> None:
x: List[int] = ListAlias()
[out]
def f():
r0, x :: list
L0:
r0 = PyList_New(0)
x = r0
return 1
[case testNewListTwoItems]
from typing import List
def f() -> None:
x: List[int] = [1, 2]
[out]
def f():
r0 :: list
r1, r2 :: object
r3 :: ptr
x :: list
L0:
r0 = PyList_New(2)
r1 = object 1
r2 = object 2
r3 = list_items r0
buf_init_item r3, 0, r1
buf_init_item r3, 1, r2
keep_alive r0
x = r0
return 1
[case testNewListTenItems]
from typing import List
def f() -> None:
x: List[str] = ['a', 'b', 'c', 'd', 'e',
'f', 'g', 'h', 'i', 'j']
[out]
def f():
r0, r1, r2, r3, r4, r5, r6, r7, r8, r9 :: str
r10, x :: list
L0:
r0 = 'a'
r1 = 'b'
r2 = 'c'
r3 = 'd'
r4 = 'e'
r5 = 'f'
r6 = 'g'
r7 = 'h'
r8 = 'i'
r9 = 'j'
r10 = CPyList_Build(10, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9)
x = r10
return 1
[case testListAdd]
from typing import List
def f(a: List[int], b: List[int]) -> None:
c = a + b
[out]
def f(a, b):
a, b, r0, c :: list
L0:
r0 = PySequence_Concat(a, b)
c = r0
return 1
[case testListIAdd]
from typing import List, Any
def f(a: List[int], b: Any) -> None:
a += b
[out]
def f(a, b):
a :: list
b :: object
r0 :: list
L0:
r0 = PySequence_InPlaceConcat(a, b)
a = r0
return 1
[case testListMultiply]
from typing import List
def f(a: List[int]) -> None:
b = a * 2
b = 3 * [4]
[out]
def f(a):
a, r0, b, r1 :: list
r2 :: object
r3 :: ptr
r4 :: list
L0:
r0 = CPySequence_Multiply(a, 4)
b = r0
r1 = PyList_New(1)
r2 = object 4
r3 = list_items r1
buf_init_item r3, 0, r2
keep_alive r1
r4 = CPySequence_RMultiply(6, r1)
b = r4
return 1
[case testListIMultiply]
from typing import List
def f(a: List[int]) -> None:
a *= 2
[out]
def f(a):
a, r0 :: list
L0:
r0 = CPySequence_InPlaceMultiply(a, 4)
a = r0
return 1
[case testListLen]
from typing import List
def f(a: List[int]) -> int:
return len(a)
[out]
def f(a):
a :: list
r0 :: native_int
r1 :: short_int
L0:
r0 = var_object_size a
r1 = r0 << 1
return r1
[case testListClear]
from typing import List
def f(l: List[int]) -> None:
return l.clear()
[out]
def f(l):
l :: list
r0 :: bit
L0:
r0 = CPyList_Clear(l)
return 1
[case testListCopy]
from typing import List
from typing import Any
def f(a: List[Any]) -> List[Any]:
return a.copy()
[out]
def f(a):
a, r0 :: list
L0:
r0 = CPyList_Copy(a)
return r0
[case testListAppend]
from typing import List
def f(a: List[int], x: int) -> None:
a.append(x)
[out]
def f(a, x):
a :: list
x :: int
r0 :: object
r1 :: i32
r2 :: bit
L0:
r0 = box(int, x)
r1 = PyList_Append(a, r0)
r2 = r1 >= 0 :: signed
return 1
[case testIndexLvalue]
from typing import List
def increment(l: List[int]) -> List[int]:
for i in range(len(l)):
l[i] += 1
return l
[out]
def increment(l):
l :: list
r0 :: native_int
r1, r2 :: short_int
i :: int
r3 :: bit
r4, r5, r6 :: object
r7 :: bit
r8 :: short_int
L0:
r0 = var_object_size l
r1 = r0 << 1
r2 = 0
i = r2
L1:
r3 = int_lt r2, r1
if r3 goto L2 else goto L4 :: bool
L2:
i = r2
r4 = CPyList_GetItem(l, i)
r5 = object 1
r6 = PyNumber_InPlaceAdd(r4, r5)
r7 = CPyList_SetItem(l, i, r6)
L3:
r8 = r2 + 2
r2 = r8
goto L1
L4:
return l
[case testListDisplay]
from typing import List
def f(x: List[int], y: List[int]) -> List[int]:
return [1, 2, *x, *y, 3]
[out]
def f(x, y):
x, y, r0 :: list
r1, r2 :: object
r3 :: ptr
r4, r5, r6 :: object
r7 :: i32
r8 :: bit
L0:
r0 = PyList_New(2)
r1 = object 1
r2 = object 2
r3 = list_items r0
buf_init_item r3, 0, r1
buf_init_item r3, 1, r2
keep_alive r0
r4 = CPyList_Extend(r0, x)
r5 = CPyList_Extend(r0, y)
r6 = object 3
r7 = PyList_Append(r0, r6)
r8 = r7 >= 0 :: signed
return r0
[case testListIn]
from typing import List
def f(x: List[int], y: int) -> bool:
return y in x
[out]
def f(x, y):
x :: list
y :: int
r0 :: object
r1 :: i32
r2 :: bit
r3 :: bool
L0:
r0 = box(int, y)
r1 = PySequence_Contains(x, r0)
r2 = r1 >= 0 :: signed
r3 = truncate r1: i32 to builtins.bool
return r3
[case testListInsert]
from typing import List
def f(x: List[int], y: int) -> None:
x.insert(0, y)
[out]
def f(x, y):
x :: list
y :: int
r0 :: object
r1 :: i32
r2 :: bit
L0:
r0 = box(int, y)
r1 = CPyList_Insert(x, 0, r0)
r2 = r1 >= 0 :: signed
return 1
[case testListBuiltFromGenerator]
from typing import List
def f(source: List[int]) -> None:
a = list(x + 1 for x in source)
b = [x + 1 for x in source]
[out]
def f(source):
source :: list
r0 :: native_int
r1 :: list
r2, r3 :: native_int
r4 :: bit
r5 :: object
r6, x, r7 :: int
r8 :: object
r9 :: native_int
a :: list
r10 :: native_int
r11 :: list
r12, r13 :: native_int
r14 :: bit
r15 :: object
r16, x_2, r17 :: int
r18 :: object
r19 :: native_int
b :: list
L0:
r0 = var_object_size source
r1 = PyList_New(r0)
r2 = 0
L1:
r3 = var_object_size source
r4 = r2 < r3 :: signed
if r4 goto L2 else goto L4 :: bool
L2:
r5 = list_get_item_unsafe source, r2
r6 = unbox(int, r5)
x = r6
r7 = CPyTagged_Add(x, 2)
r8 = box(int, r7)
CPyList_SetItemUnsafe(r1, r2, r8)
L3:
r9 = r2 + 1
r2 = r9
goto L1
L4:
a = r1
r10 = var_object_size source
r11 = PyList_New(r10)
r12 = 0
L5:
r13 = var_object_size source
r14 = r12 < r13 :: signed
if r14 goto L6 else goto L8 :: bool
L6:
r15 = list_get_item_unsafe source, r12
r16 = unbox(int, r15)
x_2 = r16
r17 = CPyTagged_Add(x_2, 2)
r18 = box(int, r17)
CPyList_SetItemUnsafe(r11, r12, r18)
L7:
r19 = r12 + 1
r12 = r19
goto L5
L8:
b = r11
return 1
[case testGeneratorNext]
from typing import List, Optional
def test(x: List[int]) -> None:
res = next((i for i in x), None)
[out]
def test(x):
x :: list
r0, r1 :: native_int
r2 :: bit
r3 :: object
r4, i :: int
r5 :: object
r6 :: union[int, None]
r7 :: native_int
r8 :: object
res :: union[int, None]
L0:
r0 = 0
L1:
r1 = var_object_size x
r2 = r0 < r1 :: signed
if r2 goto L2 else goto L4 :: bool
L2:
r3 = list_get_item_unsafe x, r0
r4 = unbox(int, r3)
i = r4
r5 = box(int, i)
r6 = r5
goto L5
L3:
r7 = r0 + 1
r0 = r7
goto L1
L4:
r8 = box(None, 1)
r6 = r8
L5:
res = r6
return 1
[case testSimplifyListUnion]
from typing import List, Union, Optional
def narrow(a: Union[List[str], List[bytes], int]) -> int:
if isinstance(a, list):
return len(a)
return a
def loop(a: Union[List[str], List[bytes]]) -> None:
for x in a:
pass
def nested_union(a: Union[List[str], List[Optional[str]]]) -> None:
for x in a:
pass
[out]
def narrow(a):
a :: union[list, int]
r0 :: bit
r1 :: list
r2 :: native_int
r3 :: short_int
r4 :: int
L0:
r0 = PyList_Check(a)
if r0 goto L1 else goto L2 :: bool
L1:
r1 = borrow cast(list, a)
r2 = var_object_size r1
r3 = r2 << 1
keep_alive a
return r3
L2:
r4 = unbox(int, a)
return r4
def loop(a):
a :: list
r0, r1 :: native_int
r2 :: bit
r3 :: object
r4, x :: union[str, bytes]
r5 :: native_int
L0:
r0 = 0
L1:
r1 = var_object_size a
r2 = r0 < r1 :: signed
if r2 goto L2 else goto L4 :: bool
L2:
r3 = list_get_item_unsafe a, r0
r4 = cast(union[str, bytes], r3)
x = r4
L3:
r5 = r0 + 1
r0 = r5
goto L1
L4:
return 1
def nested_union(a):
a :: list
r0, r1 :: native_int
r2 :: bit
r3 :: object
r4, x :: union[str, None]
r5 :: native_int
L0:
r0 = 0
L1:
r1 = var_object_size a
r2 = r0 < r1 :: signed
if r2 goto L2 else goto L4 :: bool
L2:
r3 = list_get_item_unsafe a, r0
r4 = cast(union[str, None], r3)
x = r4
L3:
r5 = r0 + 1
r0 = r5
goto L1
L4:
return 1
[case testSorted]
from typing import List, Any
def list_sort(a: List[int]) -> None:
a.sort()
def sort_iterable(a: Any) -> None:
sorted(a)
[out]
def list_sort(a):
a :: list
r0 :: i32
r1 :: bit
L0:
r0 = PyList_Sort(a)
r1 = r0 >= 0 :: signed
return 1
def sort_iterable(a):
a :: object
r0 :: list
L0:
r0 = CPySequence_Sort(a)
return 1
[case testListBuiltFromStr]
def f2(val: str) -> str:
return val + "f2"
def test() -> None:
source = "abc"
a = [f2(x) for x in source]
[out]
def f2(val):
val, r0, r1 :: str
L0:
r0 = 'f2'
r1 = PyUnicode_Concat(val, r0)
return r1
def test():
r0, source :: str
r1 :: native_int
r2 :: bit
r3 :: list
r4 :: native_int
r5 :: bit
r6, x, r7 :: str
r8 :: native_int
a :: list
L0:
r0 = 'abc'
source = r0
r1 = CPyStr_Size_size_t(source)
r2 = r1 >= 0 :: signed
r3 = PyList_New(r1)
r4 = 0
L1:
r5 = r4 < r1 :: signed
if r5 goto L2 else goto L4 :: bool
L2:
r6 = CPyStr_GetItemUnsafe(source, r4)
x = r6
r7 = f2(x)
CPyList_SetItemUnsafe(r3, r4, r7)
L3:
r8 = r4 + 1
r4 = r8
goto L1
L4:
a = r3
return 1
[case testListBuiltFromStrExpr]
def f2(val: str) -> str:
return val + "f2"
def test() -> None:
a = [f2(x) for x in "abc"]
[out]
def f2(val):
val, r0, r1 :: str
L0:
r0 = 'f2'
r1 = PyUnicode_Concat(val, r0)
return r1
def test():
r0 :: str
r1 :: list
r2 :: native_int
r3 :: bit
r4, x, r5 :: str
r6 :: native_int
a :: list
L0:
r0 = 'abc'
r1 = PyList_New(3)
r2 = 0
goto L2
L1:
r3 = r2 < 3 :: signed
if r3 goto L2 else goto L4 :: bool
L2:
r4 = CPyStr_GetItemUnsafe(r0, r2)
x = r4
r5 = f2(x)
CPyList_SetItemUnsafe(r1, r2, r5)
L3:
r6 = r2 + 1
r2 = r6
goto L1
L4:
a = r1
return 1
[case testListBuiltFromFinalStr]
from typing import Final
source: Final = "abc"
def f2(val: str) -> str:
return val + "f2"
def test() -> None:
a = [f2(x) for x in source]
[out]
def f2(val):
val, r0, r1 :: str
L0:
r0 = 'f2'
r1 = PyUnicode_Concat(val, r0)
return r1
def test():
r0 :: str
r1 :: list
r2 :: native_int
r3 :: bit
r4, x, r5 :: str
r6 :: native_int
a :: list
L0:
r0 = 'abc'
r1 = PyList_New(3)
r2 = 0
goto L2
L1:
r3 = r2 < 3 :: signed
if r3 goto L2 else goto L4 :: bool
L2:
r4 = CPyStr_GetItemUnsafe(r0, r2)
x = r4
r5 = f2(x)
CPyList_SetItemUnsafe(r1, r2, r5)
L3:
r6 = r2 + 1
r2 = r6
goto L1
L4:
a = r1
return 1
[case testListBuiltFromBytes_64bit]
def f2(val: int) -> int:
return val + 2
def test() -> None:
source = b"abc"
a = [f2(x) for x in source]
[out]
def f2(val):
val, r0 :: int
L0:
r0 = CPyTagged_Add(val, 4)
return r0
def test():
r0, source :: bytes
r1 :: native_int
r2 :: list
r3 :: native_int
r4, r5, r6 :: bit
r7, r8, r9, r10 :: int
r11 :: object
r12, x, r13 :: int
r14 :: object
r15 :: native_int
a :: list
L0:
r0 = b'abc'
source = r0
r1 = var_object_size source
r2 = PyList_New(r1)
r3 = 0
L1:
r4 = r3 < r1 :: signed
if r4 goto L2 else goto L8 :: bool
L2:
r5 = r3 <= 4611686018427387903 :: signed
if r5 goto L3 else goto L4 :: bool
L3:
r6 = r3 >= -4611686018427387904 :: signed
if r6 goto L5 else goto L4 :: bool
L4:
r7 = CPyTagged_FromInt64(r3)
r8 = r7
goto L6
L5:
r9 = r3 << 1
r8 = r9
L6:
r10 = CPyBytes_GetItem(source, r8)
r11 = box(int, r10)
r12 = unbox(int, r11)
x = r12
r13 = f2(x)
r14 = box(int, r13)
CPyList_SetItemUnsafe(r2, r3, r14)
L7:
r15 = r3 + 1
r3 = r15
goto L1
L8:
a = r2
return 1
[case testListBuiltFromBytesExpr_64bit]
def f2(val: int) -> int:
return val + 2
def test() -> None:
a = [f2(x) for x in b"abc"]
[out]
def f2(val):
val, r0 :: int
L0:
r0 = CPyTagged_Add(val, 4)
return r0
def test():
r0 :: bytes
r1 :: list
r2 :: native_int
r3, r4, r5 :: bit
r6, r7, r8, r9 :: int
r10 :: object
r11, x, r12 :: int
r13 :: object
r14 :: native_int
a :: list
L0:
r0 = b'abc'
r1 = PyList_New(3)
r2 = 0
goto L2
L1:
r3 = r2 < 3 :: signed
if r3 goto L2 else goto L8 :: bool
L2:
r4 = r2 <= 4611686018427387903 :: signed
if r4 goto L3 else goto L4 :: bool
L3:
r5 = r2 >= -4611686018427387904 :: signed
if r5 goto L5 else goto L4 :: bool
L4:
r6 = CPyTagged_FromInt64(r2)
r7 = r6
goto L6
L5:
r8 = r2 << 1
r7 = r8
L6:
r9 = CPyBytes_GetItem(r0, r7)
r10 = box(int, r9)
r11 = unbox(int, r10)
x = r11
r12 = f2(x)
r13 = box(int, r12)
CPyList_SetItemUnsafe(r1, r2, r13)
L7:
r14 = r2 + 1
r2 = r14
goto L1
L8:
a = r1
return 1
[case testListBuiltFromFinalBytes_64bit]
from typing import Final
source: Final = b"abc"
def f2(val: int) -> int:
return val + 2
def test() -> None:
a = [f2(x) for x in source]
[out]
def f2(val):
val, r0 :: int
L0:
r0 = CPyTagged_Add(val, 4)
return r0
def test():
r0 :: bytes
r1 :: bool
r2 :: native_int
r3 :: list
r4 :: native_int
r5, r6, r7 :: bit
r8, r9, r10, r11 :: int
r12 :: object
r13, x, r14 :: int
r15 :: object
r16 :: native_int
a :: list
L0:
r0 = __main__.source :: static
if is_error(r0) goto L1 else goto L2
L1:
r1 = raise NameError('value for final name "source" was not set')
unreachable
L2:
r2 = var_object_size r0
r3 = PyList_New(r2)
r4 = 0
L3:
r5 = r4 < r2 :: signed
if r5 goto L4 else goto L10 :: bool
L4:
r6 = r4 <= 4611686018427387903 :: signed
if r6 goto L5 else goto L6 :: bool
L5:
r7 = r4 >= -4611686018427387904 :: signed
if r7 goto L7 else goto L6 :: bool
L6:
r8 = CPyTagged_FromInt64(r4)
r9 = r8
goto L8
L7:
r10 = r4 << 1
r9 = r10
L8:
r11 = CPyBytes_GetItem(r0, r9)
r12 = box(int, r11)
r13 = unbox(int, r12)
x = r13
r14 = f2(x)
r15 = box(int, r14)
CPyList_SetItemUnsafe(r3, r4, r15)
L9:
r16 = r4 + 1
r4 = r16
goto L3
L10:
a = r3
return 1
[case testListBuiltFromStars]
from typing import Final
abc: Final = "abc"
def test() -> None:
a = [str(x) for x in [*abc, *"def", *b"ghi", ("j", "k"), *("l", "m", "n")]]
[out]
def test():
r0, r1 :: str
r2 :: bytes
r3, r4 :: str
r5 :: tuple[str, str]
r6, r7, r8 :: str
r9 :: tuple[str, str, str]
r10 :: list
r11, r12, r13, r14 :: object
r15 :: i32
r16 :: bit
r17, r18 :: object
r19 :: list
r20, r21 :: native_int
r22 :: bit
r23, x :: object
r24 :: str
r25 :: native_int
a :: list
L0:
r0 = 'abc'
r1 = 'def'
r2 = b'ghi'
r3 = 'j'
r4 = 'k'
r5 = (r3, r4)
r6 = 'l'
r7 = 'm'
r8 = 'n'
r9 = (r6, r7, r8)
r10 = PyList_New(0)
r11 = CPyList_Extend(r10, r0)
r12 = CPyList_Extend(r10, r1)
r13 = CPyList_Extend(r10, r2)
r14 = box(tuple[str, str], r5)
r15 = PyList_Append(r10, r14)
r16 = r15 >= 0 :: signed
r17 = box(tuple[str, str, str], r9)
r18 = CPyList_Extend(r10, r17)
r19 = PyList_New(13)
r20 = 0
goto L2
L1:
r21 = var_object_size r10
r22 = r20 < r21 :: signed
if r22 goto L2 else goto L4 :: bool
L2:
r23 = list_get_item_unsafe r10, r20
x = r23
r24 = PyObject_Str(x)
CPyList_SetItemUnsafe(r19, r20, r24)
L3:
r25 = r20 + 1
r20 = r25
goto L1
L4:
a = r19
return 1