code: def test_single_constructor_adt():
      mod = tvm.IRModule()
      box = relay.GlobalTypeVar("box")
      a = relay.TypeVar("a")
      box_ctor = relay.Constructor("box", [a], box)
      box_data = relay.TypeData(box, [a], [box_ctor])
      mod[box] = box_data
  
      v = relay.Var("v")
      match = relay.Match(
          v,
          [
              relay.Clause(
                  relay.PatternConstructor(
                      box_ctor, [relay.PatternWildcard()]
                  ),
                  v,
              )
          ],
      )
  
      # with one constructor, having one pattern constructor case is exhaustive
      assert len(unmatched_cases(match, mod)) == 0
  
      # this will be so if we nest the constructors too
      nested_pattern = relay.Match(
          v,
          [
              relay.Clause(
                  relay.PatternConstructor(
                      box_ctor,
                      [
                          relay.PatternConstructor(
                              box_ctor,
                              [
                                  relay.PatternConstructor(
                                      box_ctor,
                                      [relay.PatternWildcard()],
                                  )
                              ],
                          )
                      ],
                  ),
                  v,
              )
          ],
      )
      assert len(unmatched_cases(nested_pattern, mod)) == 0
  
file_path: tvm/tests/python/relay/test_pass_unmatched_cases.py
imports: import tvm
  from tvm import te
  from tvm import relay
  from tvm.relay.prelude import Prelude
  from tvm.relay.analysis import unmatched_cases
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_single_constructor_adt() without return types