Skip to content

Commit aba7421

Browse files
johnzl-777claude
andcommitted
increase iteration count in early termination safety test
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 074afa1 commit aba7421

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

test/dialects/scf/test_constprop.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,17 @@ def simple_ifelse(x: int):
119119
def 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

0 commit comments

Comments
 (0)