code: def test_replace_root_write():
      s, target = replace_ir_builder()
      old_hash = s.mod["main"].__hash__()
      sref = s.get_sref(s.mod["main"].body.block)
      s.replace(sref, target)
      # Check no copy and the new body equals to target
      assert old_hash == s.mod["main"].__hash__()
      tvm.ir.assert_structural_equal(s.mod["main"].body.block, target)
  
imports: import gc
  import sys
  import pytest
  import tvm
  import tvm.testing
  from tvm import tir
  from tvm.ir import IRModule
  from tvm.script import tir
label_desc: Use image node_id 12 for calling a global function with example usage: test_replace_root_write() without return types