@@ -1057,16 +1057,16 @@ def test_conditional_jump_forward_non_const_condition(self):
10571057 expected_insts = [
10581058 ('LOAD_NAME' , 1 , 11 ),
10591059 ('POP_JUMP_IF_TRUE' , lbl := self .Label (), 12 ),
1060- ('LOAD_CONST' , 1 , 13 ),
1060+ ('LOAD_CONST' , 0 , 13 ),
10611061 ('RETURN_VALUE' , None , 13 ),
10621062 lbl ,
1063- ('LOAD_CONST' , 2 , 14 ),
1063+ ('LOAD_CONST' , 1 , 14 ),
10641064 ('RETURN_VALUE' , None , 14 ),
10651065 ]
10661066 self .cfg_optimization_test (insts ,
10671067 expected_insts ,
10681068 consts = [0 , 1 , 2 , 3 , 4 ],
1069- expected_consts = [0 , 2 , 3 ])
1069+ expected_consts = [2 , 3 ])
10701070
10711071 def test_list_exceeding_stack_use_guideline (self ):
10721072 def f ():
@@ -1107,10 +1107,10 @@ def test_multiple_foldings(self):
11071107 ('RETURN_VALUE' , None , 0 )
11081108 ]
11091109 after = [
1110- ('LOAD_CONST' , 1 , 0 ),
1110+ ('LOAD_CONST' , 0 , 0 ),
11111111 ('RETURN_VALUE' , None , 0 )
11121112 ]
1113- self .cfg_optimization_test (before , after , consts = [], expected_consts = [(2 ,), ( 1 , 2 )])
1113+ self .cfg_optimization_test (before , after , consts = [], expected_consts = [(1 , 2 )])
11141114
11151115 def test_build_empty_tuple (self ):
11161116 before = [
@@ -1277,13 +1277,13 @@ def test_conditional_jump_forward_const_condition(self):
12771277 expected_insts = [
12781278 ('NOP' , None , 11 ),
12791279 ('NOP' , None , 12 ),
1280- ('LOAD_CONST' , 1 , 14 ),
1280+ ('LOAD_CONST' , 0 , 14 ),
12811281 ('RETURN_VALUE' , None , 14 ),
12821282 ]
12831283 self .cfg_optimization_test (insts ,
12841284 expected_insts ,
12851285 consts = [0 , 1 , 2 , 3 , 4 ],
1286- expected_consts = [0 , 3 ])
1286+ expected_consts = [3 ])
12871287
12881288 def test_conditional_jump_backward_non_const_condition (self ):
12891289 insts = [
@@ -1322,18 +1322,18 @@ def test_except_handler_label(self):
13221322 insts = [
13231323 ('SETUP_FINALLY' , handler := self .Label (), 10 ),
13241324 ('POP_BLOCK' , None , - 1 ),
1325- ('LOAD_CONST' , 1 , 11 ),
1325+ ('LOAD_CONST' , 0 , 11 ),
13261326 ('RETURN_VALUE' , None , 11 ),
13271327 handler ,
1328- ('LOAD_CONST' , 2 , 12 ),
1328+ ('LOAD_CONST' , 1 , 12 ),
13291329 ('RETURN_VALUE' , None , 12 ),
13301330 ]
13311331 expected_insts = [
13321332 ('SETUP_FINALLY' , handler := self .Label (), 10 ),
1333- ('LOAD_CONST' , 1 , 11 ),
1333+ ('LOAD_CONST' , 0 , 11 ),
13341334 ('RETURN_VALUE' , None , 11 ),
13351335 handler ,
1336- ('LOAD_CONST' , 2 , 12 ),
1336+ ('LOAD_CONST' , 1 , 12 ),
13371337 ('RETURN_VALUE' , None , 12 ),
13381338 ]
13391339 self .cfg_optimization_test (insts , expected_insts , consts = list (range (5 )))
0 commit comments