code: def test_multiple_entry_functions():
      mod = tvm.IRModule()
      p = Prelude(mod)
      _, cons, nil = p.mod.get_type("List")
      hd = p.mod.get_global_var("hd")
      tl = p.mod.get_global_var("tl")
      l = nil()
      for i in [4, 3, 2, 1, 0]:
          l = cons(relay.const(i), l)
      body = hd(tl(tl(l)))
      mod["main1"] = relay.Function([], body)
  
      x = relay.var("x", shape=(1, 16))
      id_func = relay.Function([x], x)
      id_name = relay.GlobalVar("id_func")
      mod[id_name] = id_func
      mod["main2"] = relay.Function([x], id_name(x))
      mod = relay.transform.RemoveUnusedFunctions(["main1", "main2"])(
          mod
      )
      l = set([x[0].name_hint for x in mod.functions.items()])
      assert l == set(["tl", "hd", "main2", "id_func", "main1"])
  
file_path: tvm/tests/python/relay/test_pass_remove_unused_functions.py
imports: import pytest
  import tvm
  from tvm import te
  from tvm import relay
  from tvm.relay import transform
  from tvm.relay.prelude import Prelude
label_desc: Use image node_id 4 for calling a global function with example usage: test_multiple_entry_functions() without return types