def test_multifunction_source_program(self, source_function_name, override_source_function):
        """
        Input graph:

            x -> shape -> sub

        Output graph:

            const
        """
        symbolic_shape = (get_new_symbol(),)
        fixed_shape = (5,)
        new_function_name = source_function_name if override_source_function else "materialization"

        @mb.program(input_specs=[mb.TensorSpec(shape=symbolic_shape)])
        def prog(x):
            shape = mb.shape(x=x)
            return mb.sub(x=shape, y=1)

        @mb.function(input_specs=[mb.TensorSpec(shape=symbolic_shape)])
        def func2(x):
            shape = mb.shape(x=x)
            return mb.sub(x=shape, y=2)

        prog.add_function("func2", func2)

        graph_pass = PASS_REGISTRY["common::materialize_symbolic_shape_program"]
        graph_pass.function_name_to_materialization_map = {new_function_name: {"x": fixed_shape}}
        if source_function_name != "main":
            graph_pass.souce_function_name = source_function_name
        prev_prog, _, _ = apply_pass_and_basic_check(
            prog,
            graph_pass,
            skip_output_name_check=True,
            skip_output_shape_check=True,
            skip_function_name_check=True,
        )
        apply_pass_and_basic_check(prog, "common::const_elimination")

        if override_source_function:
            assert set(prog.functions.keys()) == {"main", "func2"}
        else:
            assert set(prog.functions.keys()) == {"main", "func2", "materialization"}
        assert prog.functions[new_function_name].inputs["x"].shape == fixed_shape
        assert len(get_op_types_in_program(prog, new_function_name)) == 0
        for function_name in ("main", "func2"):
            if function_name == source_function_name and override_source_function:
                continue
            else:
                assert prog.functions[function_name].inputs["x"].shape == symbolic_shape
                assert get_op_types_in_program(prev_prog, function_name) == get_op_types_in_program(
                    prog, function_name
                )

        Input graph:

            x -> shape -> sub

        Output graph:

            const
        
coremltools/converters/mil/mil/passes/tests/test_symbol_transform.py