xref: /llvm-project/llvm/test/Linker/module-flags-dont-change-others.ll (revision ff87ee4dee9c01d841182d5959cec3a998115d34)
1; RUN: llvm-link %s %S/Inputs/module-flags-dont-change-others.ll -S -o - | FileCheck %s
2
3; Test that module-flag linking doesn't change other metadata.  In particular,
4; !named should still point at the unmodified tuples (!3, !4, and !5) that
5; happen to also serve as module flags.
6
7; CHECK: !named = !{!0, !1, !2, !3, !4, !5}
8; CHECK: !llvm.module.flags = !{!6, !7, !9}
9!named = !{!0, !1, !2, !3, !4, !5}
10!llvm.module.flags = !{!3, !4, !5}
11
12; CHECK: !0 = !{}
13; CHECK: !1 = !{!0}
14; CHECK: !2 = !{!0, !1}
15; CHECK: !3 = !{i32 1, !"foo", i32 927}
16; CHECK: !4 = !{i32 5, !"bar", !0}
17; CHECK: !5 = !{i32 6, !"baz", !1}
18; CHECK: !6 = !{i32 4, !"foo", i32 37}
19; CHECK: !7 = distinct !{i32 5, !"bar", !8}
20; CHECK: !8 = distinct !{!0}
21; CHECK: !9 = distinct !{i32 6, !"baz", !10}
22; CHECK: !10 = distinct !{!0, !1}
23!0 = !{}
24!1 = !{!0}
25!2 = !{!0, !1}
26!3 = !{i32 1, !"foo", i32 927}
27!4 = !{i32 5, !"bar", !0}
28!5 = !{i32 6, !"baz", !1}
29