code: def test_tir_debug_info_with_subroutine():
      """Like test_tir_debug_info, but with a TIR subroutine
  
      The current InstallDebugSpans applies to a single PrimFunc.  This
      test verifies that the existence of device-side subroutines
  
      """
  
      def find_span(m):
          func = next(m.functions.values())
          return func.body.block.body.span
  
      @tvm.script.ir_module
      class module_before:
          @T.prim_func
          def main(a: T.handle, b: T.handle):
              T.func_attr(
                  {
                      "global_symbol": "main",
                      "tir.noalias": True,
                      "target": T.target("llvm"),
                  }
              )
              A = T.match_buffer(a, (8,), dtype="float32")
              B = T.match_buffer(b, (8,), dtype="float32")
              for i in range(8):
                  with T.block("B"):
                      vi = T.axis.spatial(8, i)
                      module_before.subroutine(
                          T.address_of(A[vi]), T.address_of(B[vi])
                      )
  
          @T.prim_func
          def subroutine(
              a_ptr: T.handle("float32"), b_ptr: T.handle("float32")
          ):
              T.func_attr(
                  {"global_symbol": "main", "tir.noalias": True}
              )
              A = T.decl_buffer(1, "float32", data=a_ptr)
              B = T.decl_buffer(1, "float32", data=b_ptr)
              B[0] = A[1] + 1.0
  
      span_before = find_span(module_before)
      assert span_before is None
  
      module_after = tir.transform.InstallDebugSpans()(module_before)
      span_after = find_span(module_after)
  
      # Check that the module name has been added and a line number is present
      assert span_after.source_name.name == "main.tir"
      assert span_after.line == 4
  
file_path: tvm/tests/python/tir-base/test_debug_info.py
imports: import tvm
  import tvm.testing
  from tvm import tir
  from tvm import relay
  from tvm.script import tir
  from typing import List, Dict
  import re
label_desc: Use image node_id 4 for calling a global function with example usage: test_tir_debug_info_with_subroutine() and returns: func