<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - 'invalid subroutine type ref' when linking with custom meta data"
   href="https://llvm.org/bugs/show_bug.cgi?id=28697">28697</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>'invalid subroutine type ref' when linking with custom meta data
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.9
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>robin@icir.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>With the code below, it looks like llvm-link merges the debug information in
b.ll with the custom metadata in a.ll. Is that a bug, or am I missing
something? This is with a current 3.9.0 version.

# cat cat a.ll
define void @a() {
  ret void
}

!bar = !{!3}

!3 = !{void ()* @a}

# cat b.ll
define void @foo() !dbg !20 {
  ret void
}

!llvm.module.flags = !{!17, !18}

!0 = distinct !DICompileUnit(language: DW_LANG_C89, file: !1)
!1 = !DIFile(filename: "x.c", directory: "/tmp")
!17 = !{i32 2, !"Dwarf Version", i32 4}
!18 = !{i32 2, !"Debug Info Version", i32 3}
!20 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 92, type:
!21, unit: !0)
!21 = !DISubroutineType(types: !22)
!22 = !{null}
!23 = !{}

# llvm-link -o out a.ll b.ll
invalid subroutine type ref
!5 = !DISubroutineType(types: !0)
!0 = !{void ()* @a}
void ()* @a
All DICompileUnits must be listed in llvm.dbg.cu
llvm-link: error: linked module is broken!</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>