File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,17 +119,17 @@ def simple_ifelse(x: int):
119119def test_no_early_termination_when_body_uses_iter_var ():
120120 """Early termination must not fire when the body references the iteration
121121 variable, because later iterations may follow different code paths that
122- affect purity. Here the impure ``ImpureOp`` is guarded by ``i == 2 ``,
123- so the loop body is impure only on iteration 2 . If early termination
122+ affect purity. Here the impure ``ImpureOp`` is guarded by ``i == 50 ``,
123+ so the loop body is impure only on iteration 50 . If early termination
124124 incorrectly broke after iteration 1 (where loop_vars converge), the
125125 for-loop would be marked as pure when it is not."""
126126
127127 _group = structural_no_opt .add (_impure_dialect )
128128
129129 @_group
130130 def impure_on_later_iter (x : int ) -> int :
131- for i in range (5 ):
132- if i == 2 :
131+ for i in range (100 ):
132+ if i == 50 :
133133 ImpureOp ()
134134 x = x + 1
135135 return x
You can’t perform that action at this time.
0 commit comments