File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,16 +82,27 @@ def test_iter_invalid_types(self):
8282 block [:] = [nop ]
8383 self .assertEqual (len (block ), 1 )
8484
85- # Only one jump allowed and only at the end — caught at extend time
85+ # Only one jump allowed and only at the end
8686 block = BasicBlock ()
8787 block2 = BasicBlock ()
88+ # caught at extend time (within batch)
8889 with self .assertRaises (ValueError ):
8990 block .extend (
9091 [
9192 Instr ("JUMP_FORWARD" , block2 ),
9293 Instr ("NOP" ),
9394 ]
9495 )
96+ # caught at append time (cross-boundary)
97+ block = BasicBlock ()
98+ block .append (Instr ("JUMP_FORWARD" , block2 ))
99+ with self .assertRaises (ValueError ):
100+ block .append (Instr ("NOP" ))
101+ # caught at extend time (cross-boundary)
102+ block = BasicBlock ()
103+ block .append (Instr ("JUMP_FORWARD" , block2 ))
104+ with self .assertRaises (ValueError ):
105+ block .extend ([Instr ("NOP" )])
95106
96107 # jump target must be a BasicBlock
97108 block = BasicBlock ()
You can’t perform that action at this time.
0 commit comments