def test_only_feeds_in_update_state():
        """
        If value only feeds into multiple coreml_update_state ops, the graph pass has no affects
        """

        @mb.program(
            input_specs=[
                mb.TensorSpec(shape=(1,), dtype=types.fp16),
                mb.StateTensorSpec(shape=(1,), dtype=types.fp16),
            ],
            opset_version=AvailableTarget.iOS18,
        )
        def prog(x, state):
            x = mb.sin(x=x)
            mb.coreml_update_state(state=state, value=x)
            mb.coreml_update_state(state=state, value=x)
            mb.coreml_update_state(state=state, value=x)
            return x

        apply_pass_and_basic_check(prog, "common::prefer_state_in_downstream")
        block = prog.functions["main"]

        sin_op = prog.find_ops(op_type="sin")[0]
        update_state_ops = prog.find_ops(op_type="coreml_update_state")
        for op in update_state_ops:
            assert op.value == sin_op.outputs[0]

        assert block.outputs[0] == sin_op.outputs[0]

        If value only feeds into multiple coreml_update_state ops, the graph pass has no affects
        
coremltools/converters/mil/mil/passes/tests/test_state_passes.py