code: def test_domain_cpp_ast_fundamental_types(type_, id_v2):
      # see https://en.cppreference.com/w/cpp/language/types
      def make_id_v1():
          if type_ == "decltype(auto)":
              return None
          id_ = type_.replace(" ", "-").replace("long", "l")
          if "__int" not in type_:
              id_ = id_.replace("int", "i")
          id_ = id_.replace("bool", "b").replace("char", "c")
          id_ = id_.replace("wc_t", "wchar_t").replace(
              "c16_t", "char16_t"
          )
          id_ = id_.replace("c8_t", "char8_t")
          id_ = id_.replace("c32_t", "char32_t")
          return f"f__{id_}"
  
      def make_id_v2():
          id_ = id_v2
          if type_ == "std::nullptr_t":
              id_ = "NSt9nullptr_tE"
          return f"1f{id_}"
  
      id1 = make_id_v1()
      id2 = make_id_v2()
  
      input = f"void f({type_.replace(' ', '  ')} arg)"
      output = f"void f({type_} arg)"
  
      check("function", input, {1: id1, 2: id2}, output=output)
      if " " in type_:
          # try permutations of all components
          tcs = type_.split()
          for p in itertools.permutations(tcs):
              input = f"void f({' '.join(p)} arg)"
              check("function", input, {1: id1, 2: id2})
  
imports: import itertools
  import re
  import zlib
  import pytest
  import sphinx.domains.cpp
  from sphinx import addnodes
  from sphinx.addnodes import desc, desc_content, desc_name, desc_parameter, desc_parameterlist, desc_sig_name, desc_sig_space, desc_signature, desc_signature_line, pending_xref
  from sphinx.domains.cpp import DefinitionError, DefinitionParser, NoOldIdError, Symbol, _id_prefix, _max_id
  from sphinx.ext.intersphinx import load_mappings, normalize_intersphinx_mapping
  from sphinx.testing import restructuredtext
  from sphinx.testing.util import assert_node
  from sphinx.writers.text import STDINDENT
label_desc: Use image node_id 4 for calling a global function with example usage: test_domain_cpp_ast_fundamental_types(type_, id_v2) and returns: str, id_, str, id_, None