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, !8}
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 = !{i32 5, !"bar", !1}
20; CHECK: !8 = !{i32 6, !"baz", !2}
21!0 = !{}
22!1 = !{!0}
23!2 = !{!0, !1}
24!3 = !{i32 1, !"foo", i32 927}
25!4 = !{i32 5, !"bar", !0}
26!5 = !{i32 6, !"baz", !1}
27