def test_no_other_child_op():
        """
        If the val of the coreml_update_state doesn't feed into any other op, and only serves as a block output,
        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)
            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]
        assert block.outputs[0] == sin_op.outputs[0]

        If the val of the coreml_update_state doesn't feed into any other op, and only serves as a block output,
        the graph pass has no affects.
        
coremltools/converters/mil/mil/passes/tests/test_state_passes.py