================
@@ -0,0 +1,46 @@
+; RUN: llvm-as %s -o %t.bc
+; RUN: llvm-as %p/../Inputs/cleanup-retained-nodes.ll -o %t.global.bc
+; RUN: llvm-link %t.global.bc %t.bc %t.bc -o %t.linked.bc
+; RUN: opt --passes=verify %t.linked.bc -o /dev/null
+; RUN: llvm-dis %t.linked.bc -o - | FileCheck %s
--implicit-check-not=DICompositeType
+
+; During module loading, if a local type appears in retainedNodes
+; field of multiple DISubprograms due to ODR-uniquing,
+; retainedNodes should be cleaned up, so that only one DISubprogram
+; will have this type in its retainedNodes.
+
+; CHECK: distinct !DICompositeType(tag: DW_TAG_class_type, {{.*}}, identifier:
"type_global_in_another_module")
+; CHECK: [[EMPTY:![0-9]+]] = !{}
+; CHECK: [[BAR1:![0-9]+]] = distinct !DISubprogram(name: "bar", {{.*}},
retainedNodes: [[RN_BAR1:![0-9]+]])
+; CHECK: [[RN_BAR1]] = !{[[T1:![0-9]+]], [[T1:![0-9]+]], [[T1:![0-9]+]],
[[T2:![0-9]+]]}
----------------
jmorse wrote:
Each of these T1 variables capture, can the second and third just be `[[T1]]`?
The fact that the same node appears multiple times is presumably something
intended to be checked, to ensure `type_global_in_another_module` doesn't
appear here.
https://github.com/llvm/llvm-project/pull/165032
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits