@@ -1123,7 +1123,6 @@ def trace(frame, event, arg):
11231123
11241124class DirectCfgOptimizerTests (CfgOptimizationTestCase ):
11251125
1126- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
11271126 def test_optimize_cfg_const_index_out_of_range (self ):
11281127 insts = [
11291128 ('LOAD_CONST' , 2 , 0 ),
@@ -1133,7 +1132,6 @@ def test_optimize_cfg_const_index_out_of_range(self):
11331132 with self .assertRaisesRegex (ValueError , "out of range" ):
11341133 _testinternalcapi .optimize_cfg (seq , [0 , 1 ], 0 )
11351134
1136- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
11371135 def test_optimize_cfg_consts_must_be_list (self ):
11381136 insts = [
11391137 ('LOAD_CONST' , 0 , 0 ),
@@ -1143,15 +1141,13 @@ def test_optimize_cfg_consts_must_be_list(self):
11431141 with self .assertRaisesRegex (TypeError , "consts must be a list" ):
11441142 _testinternalcapi .optimize_cfg (seq , (0 ,), 0 )
11451143
1146- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
11471144 def test_compiler_codegen_metadata_consts_roundtrips_optimize_cfg (self ):
11481145 tree = ast .parse ("x = (1, 2)" , mode = "exec" , optimize = 1 )
11491146 insts , meta = _testinternalcapi .compiler_codegen (tree , "<s>" , 0 )
11501147 consts = meta ["consts" ]
11511148 self .assertIsInstance (consts , list )
11521149 _testinternalcapi .optimize_cfg (insts , consts , 0 )
11531150
1154- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
11551151 def test_compiler_codegen_consts_include_none_required_for_implicit_return (self ):
11561152 # Module "pass" only needs the const table entry for None once
11571153 # _PyCodegen_AddReturnAtEnd runs. If metadata["consts"] were taken
@@ -2238,7 +2234,6 @@ def test_conditional_jump_forward_const_condition(self):
22382234 consts = [0 , 1 , 2 , 3 , 4 ],
22392235 expected_consts = [0 ])
22402236
2241- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
22422237 def test_conditional_jump_backward_non_const_condition (self ):
22432238 insts = [
22442239 lbl1 := self .Label (),
@@ -2256,7 +2251,6 @@ def test_conditional_jump_backward_non_const_condition(self):
22562251 ]
22572252 self .cfg_optimization_test (insts , expected , consts = list (range (5 )))
22582253
2259- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
22602254 def test_conditional_jump_backward_const_condition (self ):
22612255 # The unreachable branch of the jump is removed
22622256 insts = [
@@ -2294,7 +2288,6 @@ def test_except_handler_label(self):
22942288 ]
22952289 self .cfg_optimization_test (insts , expected_insts , consts = list (range (5 )))
22962290
2297- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
22982291 def test_no_unsafe_static_swap (self ):
22992292 # We can't change order of two stores to the same location
23002293 insts = [
@@ -2319,7 +2312,6 @@ def test_no_unsafe_static_swap(self):
23192312 ]
23202313 self .cfg_optimization_test (insts , expected_insts , consts = list (range (3 )), nlocals = 1 )
23212314
2322- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
23232315 def test_dead_store_elimination_in_same_lineno (self ):
23242316 insts = [
23252317 ('LOAD_CONST' , 0 , 1 ),
@@ -2342,7 +2334,6 @@ def test_dead_store_elimination_in_same_lineno(self):
23422334 ]
23432335 self .cfg_optimization_test (insts , expected_insts , consts = list (range (3 )), nlocals = 1 )
23442336
2345- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
23462337 def test_no_dead_store_elimination_in_different_lineno (self ):
23472338 insts = [
23482339 ('LOAD_CONST' , 0 , 1 ),
@@ -2366,7 +2357,6 @@ def test_no_dead_store_elimination_in_different_lineno(self):
23662357 ]
23672358 self .cfg_optimization_test (insts , expected_insts , consts = list (range (3 )), nlocals = 1 )
23682359
2369- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
23702360 def test_unconditional_jump_threading (self ):
23712361
23722362 def get_insts (lno1 , lno2 , op1 , op2 ):
@@ -2411,7 +2401,6 @@ def get_insts(lno1, lno2, op1, op2):
24112401 ]
24122402 self .cfg_optimization_test (insts , expected_insts , consts = list (range (5 )))
24132403
2414- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
24152404 def test_list_to_tuple_get_iter (self ):
24162405 # for _ in (*foo, *bar) -> for _ in [*foo, *bar]
24172406 INTRINSIC_LIST_TO_TUPLE = 6
@@ -2482,7 +2471,6 @@ def check(self, insts, expected_insts, consts=None):
24822471 self .cfg_optimization_test (insts_bb , expected_insts_bb ,
24832472 consts = insts_consts , expected_consts = exp_consts )
24842473
2485- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
24862474 def test_optimized (self ):
24872475 insts = [
24882476 ("LOAD_FAST" , 0 , 1 ),
@@ -2510,7 +2498,6 @@ def test_optimized(self):
25102498 ]
25112499 self .check (insts , expected )
25122500
2513- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
25142501 def test_unoptimized_if_unconsumed (self ):
25152502 insts = [
25162503 ("LOAD_FAST" , 0 , 1 ),
@@ -2536,7 +2523,6 @@ def test_unoptimized_if_unconsumed(self):
25362523 ]
25372524 self .check (insts , expected )
25382525
2539- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
25402526 def test_unoptimized_if_support_killed (self ):
25412527 insts = [
25422528 ("LOAD_FAST" , 0 , 1 ),
@@ -2562,7 +2548,6 @@ def test_unoptimized_if_support_killed(self):
25622548 ]
25632549 self .check (insts , insts )
25642550
2565- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
25662551 def test_unoptimized_if_aliased (self ):
25672552 insts = [
25682553 ("LOAD_FAST" , 0 , 1 ),
@@ -2577,7 +2562,6 @@ def test_unoptimized_if_aliased(self):
25772562 ]
25782563 self .check (insts , insts )
25792564
2580- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
25812565 def test_consume_no_inputs (self ):
25822566 insts = [
25832567 ("LOAD_FAST" , 0 , 1 ),
@@ -2587,7 +2571,6 @@ def test_consume_no_inputs(self):
25872571 ]
25882572 self .check (insts , insts )
25892573
2590- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
25912574 def test_consume_some_inputs_no_outputs (self ):
25922575 insts = [
25932576 ("LOAD_FAST" , 0 , 1 ),
@@ -2596,7 +2579,6 @@ def test_consume_some_inputs_no_outputs(self):
25962579 ]
25972580 self .check (insts , insts )
25982581
2599- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
26002582 def test_check_exc_match (self ):
26012583 insts = [
26022584 ("LOAD_FAST" , 0 , 1 ),
@@ -2610,7 +2592,6 @@ def test_check_exc_match(self):
26102592 ]
26112593 self .check (insts , expected )
26122594
2613- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
26142595 def test_for_iter (self ):
26152596 insts = [
26162597 ("LOAD_FAST" , 0 , 1 ),
@@ -2626,7 +2607,6 @@ def test_for_iter(self):
26262607 ]
26272608 self .cfg_optimization_test (insts , insts , consts = [None ])
26282609
2629- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
26302610 def test_load_attr (self ):
26312611 insts = [
26322612 ("LOAD_FAST" , 0 , 1 ),
@@ -2649,7 +2629,6 @@ def test_load_attr(self):
26492629 ]
26502630 self .check (insts , expected )
26512631
2652- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
26532632 def test_super_attr (self ):
26542633 insts = [
26552634 ("LOAD_FAST" , 0 , 1 ),
@@ -2680,7 +2659,6 @@ def test_super_attr(self):
26802659 ]
26812660 self .check (insts , expected )
26822661
2683- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
26842662 def test_send (self ):
26852663 insts = [
26862664 ("LOAD_FAST" , 0 , 1 ),
@@ -2704,7 +2682,6 @@ def test_send(self):
27042682 ]
27052683 self .cfg_optimization_test (insts , expected , consts = [None ])
27062684
2707- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
27082685 def test_format_simple (self ):
27092686 # FORMAT_SIMPLE will leave its operand on the stack if it's a unicode
27102687 # object. We treat it conservatively and assume that it always leaves
@@ -2728,7 +2705,6 @@ def test_format_simple(self):
27282705 ]
27292706 self .check (insts , expected )
27302707
2731- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
27322708 def test_set_function_attribute (self ):
27332709 # SET_FUNCTION_ATTRIBUTE leaves the function on the stack
27342710 insts = [
@@ -2755,7 +2731,6 @@ def test_set_function_attribute(self):
27552731 ]
27562732 self .cfg_optimization_test (insts , expected , consts = [None ])
27572733
2758- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
27592734 def test_get_yield_from_iter (self ):
27602735 # GET_YIELD_FROM_ITER may leave its operand on the stack
27612736 insts = [
@@ -2774,15 +2749,13 @@ def test_get_yield_from_iter(self):
27742749 ]
27752750 self .cfg_optimization_test (insts , insts , consts = [None ])
27762751
2777- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
27782752 def test_push_exc_info (self ):
27792753 insts = [
27802754 ("LOAD_FAST" , 0 , 1 ),
27812755 ("PUSH_EXC_INFO" , None , 2 ),
27822756 ]
27832757 self .check (insts , insts )
27842758
2785- @unittest .expectedFailure # TODO: RUSTPYTHON; compiler IR pipeline
27862759 def test_load_special (self ):
27872760 # LOAD_SPECIAL may leave self on the stack
27882761 insts = [
0 commit comments