Wenju He a6e870d0b6
[IRLinker] Don't add duplicate named MD node operand to dest module (#146020)
Fix llvm.ident exploding when linking many bitcode files in libclc. This
should de-duplicate other named metadata as well, e.g.
opencl.spir.version and opencl.ocl.version.

This PR is a re-submit of https://reviews.llvm.org/D20582 (authored by
Matt Arsenault) with update that only checks MD node pointer for
duplication according to review comment in that PR.

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2025-08-12 17:18:42 +08:00

11 lines
344 B
LLVM

; RUN: llvm-link %S/Inputs/ident.a.ll %S/Inputs/ident.b.ll -S | FileCheck %s
; Verify that multiple input llvm.ident metadata are linked together, and
; duplicate "Compiler V2" metadata from the two inputs are unified.
; CHECK-DAG: !llvm.ident = !{!0, !1, !2}
; CHECK-DAG: "Compiler V1"
; CHECK-DAG: "Compiler V2"
; CHECK-DAG: "Compiler V3"