code: def test_dwarf_debug_information():
      nn = 1024
      n = tvm.runtime.convert(nn)
      A = te.placeholder((n,), name="A")
      B = te.placeholder((n,), name="B")
      C = te.compute(A.shape, lambda *i: A(*i) + B(*i), name="C")
      s = te.create_schedule(C.op)
      xo, xi = s[C].split(C.op.axis[0], factor=4)
      s[C].parallel(xo)
      s[C].vectorize(xi)
  
      def check_llvm_object():
          if tvm.target.codegen.llvm_version_major() < 5:
              return
          if tvm.target.codegen.llvm_version_major() > 6:
              return
          # build two functions
          f2 = tvm.lower(s, [A, B, C], name="fadd1")
          f1 = tvm.lower(s, [A, B, C], name="fadd2")
          m = tvm.build([f1, f2], "llvm")
          temp = utils.tempdir()
          o_path = temp.relpath("temp.o")
          m.save(o_path)
          import shutil
          import subprocess
          import sys
  
          # Try the dwarfdump utility (OS X)
          if shutil.which("dwarfdump"):
              output = subprocess.check_output(["dwarfdump", o_path])
              assert re.search(
                  r"""DW_AT_name\\t\("fadd1"\)""", str(output)
              )
              assert re.search(
                  r"""DW_AT_name\\t\("fadd2"\)""", str(output)
              )
  
          # Try gobjdump (OS X)
          if shutil.which("gobjdump"):
              output = subprocess.check_output(
                  ["gobjdump", "--dwarf", o_path]
              )
              assert re.search(r"""DW_AT_name.*fadd1""", str(output))
              assert re.search(r"""DW_AT_name.*fadd2""", str(output))
  
          # Try objdump (Linux) - Darwin objdump has different DWARF syntax.
          if shutil.which("objdump") and sys.platform != "darwin":
              output = subprocess.check_output(
                  ["objdump", "--dwarf", o_path]
              )
              assert re.search(r"""DW_AT_name.*fadd1""", str(output))
              assert re.search(r"""DW_AT_name.*fadd2""", str(output))
  
      def check_llvm_ir():
          if tvm.target.codegen.llvm_version_major() < 5:
              return
          if tvm.target.codegen.llvm_version_major() > 6:
              return
          # build two functions
          f2 = tvm.lower(s, [A, B, C], name="fadd1")
          f1 = tvm.lower(s, [A, B, C], name="fadd2")
          m = tvm.build(
              [f1, f2], target="llvm -mtriple=aarch64-linux-gnu"
          )
          ll = m.get_source("ll")
  
          # On non-Darwin OS, don't explicitly specify DWARF version.
          import re
  
          assert not re.search(r""""Dwarf Version""" "", ll)
          assert re.search(r"""llvm.dbg.value""", ll)
  
          # Try Darwin, require DWARF-2
          m = tvm.build(
              [f1, f2], target="llvm -mtriple=x86_64-apple-darwin-macho"
          )
          ll = m.get_source("ll")
          assert re.search(r"""i32 4, !"Dwarf Version", i32 2""", ll)
          assert re.search(r"""llvm.dbg.value""", ll)
  
      check_llvm_object()
      check_llvm_ir()
  
imports: import collections
  import ctypes
  import json
  import math
  import numpy
  import pytest
  import re
  import sys
  import tvm
  import tvm.testing
  from tvm import te
  from tvm.contrib import clang, utils
  from tvm.relay.backend import Runtime
  from tvm.script import tir, ir
  from tvm.target.codegen import llvm_get_intrinsic_name, llvm_lookup_intrinsic_id
label_desc: Use image node_id 20 for calling a global function with example usage: test_dwarf_debug_information() without return types