@@ -1349,71 +1349,6 @@ def test_fold_tuple_of_constants(self):
13491349        ]
13501350        self .cfg_optimization_test (same , same , consts = [])
13511351
1352-     def  test_fold_constant_intrinsic_list_to_tuple (self ):
1353-         INTRINSIC_LIST_TO_TUPLE  =  6 
1354- 
1355-         # long tuple 
1356-         consts  =  1000 
1357-         before  =  (
1358-             [('BUILD_LIST' , 0 , 0 )] + 
1359-             [('LOAD_CONST' , 0 , 0 ), ('LIST_APPEND' , 1 , 0 )] *  consts  + 
1360-             [('CALL_INTRINSIC_1' , INTRINSIC_LIST_TO_TUPLE , 0 ), ('RETURN_VALUE' , None , 0 )]
1361-         )
1362-         after  =  [
1363-             ('LOAD_CONST' , 1 , 0 ),
1364-             ('RETURN_VALUE' , None , 0 )
1365-         ]
1366-         result_const  =  tuple (["test" ] *  consts )
1367-         self .cfg_optimization_test (before , after , consts = ["test" ], expected_consts = ["test" , result_const ])
1368- 
1369-         # empty list 
1370-         before  =  [
1371-             ('BUILD_LIST' , 0 , 0 ),
1372-             ('CALL_INTRINSIC_1' , INTRINSIC_LIST_TO_TUPLE , 0 ),
1373-             ('RETURN_VALUE' , None , 0 )
1374-         ]
1375-         after  =  [
1376-             ('LOAD_CONST' , 0 , 0 ),
1377-             ('RETURN_VALUE' , None , 0 )
1378-         ]
1379-         self .cfg_optimization_test (before , after , consts = [], expected_consts = [()])
1380- 
1381-         # multiple BUILD_LIST 0: ([], 1, [], 2) 
1382-         same  =  [
1383-             ('BUILD_LIST' , 0 , 0 ),
1384-             ('BUILD_LIST' , 0 , 0 ),
1385-             ('LIST_APPEND' , 1 , 0 ),
1386-             ('LOAD_SMALL_INT' , 1 , 0 ),
1387-             ('LIST_APPEND' , 1 , 0 ),
1388-             ('BUILD_LIST' , 0 , 0 ),
1389-             ('LIST_APPEND' , 1 , 0 ),
1390-             ('LOAD_SMALL_INT' , 2 , 0 ),
1391-             ('LIST_APPEND' , 1 , 0 ),
1392-             ('CALL_INTRINSIC_1' , INTRINSIC_LIST_TO_TUPLE , 0 ),
1393-             ('RETURN_VALUE' , None , 0 )
1394-         ]
1395-         self .cfg_optimization_test (same , same , consts = [])
1396- 
1397-         # nested folding: (1, 1+1, 3) 
1398-         before  =  [
1399-             ('BUILD_LIST' , 0 , 0 ),
1400-             ('LOAD_SMALL_INT' , 1 , 0 ),
1401-             ('LIST_APPEND' , 1 , 0 ),
1402-             ('LOAD_SMALL_INT' , 1 , 0 ),
1403-             ('LOAD_SMALL_INT' , 1 , 0 ),
1404-             ('BINARY_OP' , get_binop_argval ('NB_ADD' ), 0 ),
1405-             ('LIST_APPEND' , 1 , 0 ),
1406-             ('LOAD_SMALL_INT' , 3 , 0 ),
1407-             ('LIST_APPEND' , 1 , 0 ),
1408-             ('CALL_INTRINSIC_1' , INTRINSIC_LIST_TO_TUPLE , 0 ),
1409-             ('RETURN_VALUE' , None , 0 )
1410-         ]
1411-         after  =  [
1412-             ('LOAD_CONST' , 0 , 0 ),
1413-             ('RETURN_VALUE' , None , 0 )
1414-         ]
1415-         self .cfg_optimization_test (before , after , consts = [], expected_consts = [(1 , 2 , 3 )])
1416- 
14171352    def  test_optimize_if_const_list (self ):
14181353        before  =  [
14191354            ('NOP' , None , 0 ),
0 commit comments