Always treat DISubprogram reached by DIImportedEntity as needed.
[oota-llvm.git] / test / Linker / mdlocation.ll
1 ; RUN: llvm-link %s %S/Inputs/mdlocation.ll -o - -S | FileCheck %s
2
3 ; Test that DILocations are remapped properly.
4
5 ; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !8, !9, !10, !11}
6 !named = !{!0, !1, !2, !3, !4, !5}
7
8 ; CHECK:      !0 = distinct !DISubprogram(
9 ; CHECK-NEXT: !1 = !DILocation(line: 3, column: 7, scope: !0)
10 ; CHECK-NEXT: !2 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !1)
11 ; CHECK-NEXT: !3 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !2)
12 ; CHECK-NEXT: !4 = distinct !DILocation(line: 3, column: 7, scope: !0)
13 ; CHECK-NEXT: !5 = distinct !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !4)
14 ; CHECK-NEXT: !6 = distinct !DISubprogram(
15 ; CHECK-NEXT: !7 = !DILocation(line: 3, column: 7, scope: !6)
16 ; CHECK-NEXT: !8 = !DILocation(line: 3, column: 7, scope: !6, inlinedAt: !7)
17 ; CHECK-NEXT: !9 = !DILocation(line: 3, column: 7, scope: !6, inlinedAt: !8)
18 ; CHECK-NEXT: !10 = distinct !DILocation(line: 3, column: 7, scope: !6)
19 ; CHECK-NEXT: !11 = distinct !DILocation(line: 3, column: 7, scope: !6, inlinedAt: !10)
20 !0 = distinct !DISubprogram() ; Use this as a scope.
21 !1 = !DILocation(line: 3, column: 7, scope: !0)
22 !2 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !1)
23 !3 = !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !2)
24 ; Test distinct nodes.
25 !4 = distinct !DILocation(line: 3, column: 7, scope: !0)
26 !5 = distinct !DILocation(line: 3, column: 7, scope: !0, inlinedAt: !4)