summaryrefslogtreecommitdiffstats
path: root/llvm/test/Linker/mdlocation.ll
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-14 01:20:27 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-01-14 01:20:27 +0000
commit47d82981d660b9380554fb9671cf1a0a6cea63b9 (patch)
tree88c509b06a4fc7b27a63f1f98786fb630ceaf2c6 /llvm/test/Linker/mdlocation.ll
parentae38f30d7b79319510c15a0413cccd65474f12ac (diff)
downloadbcm5719-llvm-47d82981d660b9380554fb9671cf1a0a6cea63b9.tar.gz
bcm5719-llvm-47d82981d660b9380554fb9671cf1a0a6cea63b9.zip
Utils: Add mapping for uniqued MDLocations
Still doesn't handle distinct ones. Part of PR21433. llvm-svn: 225914
Diffstat (limited to 'llvm/test/Linker/mdlocation.ll')
-rw-r--r--llvm/test/Linker/mdlocation.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/llvm/test/Linker/mdlocation.ll b/llvm/test/Linker/mdlocation.ll
new file mode 100644
index 00000000000..0b949d836fe
--- /dev/null
+++ b/llvm/test/Linker/mdlocation.ll
@@ -0,0 +1,27 @@
+; RUN: llvm-link %s %S/Inputs/mdlocation.ll -o - -S | FileCheck %s
+
+; Test that MDLocations are remapped properly.
+
+; CHECK: !named = !{!0, !1, !2, !3, !4, !5, !6, !7, !0, !1, !2, !3, !8, !9, !10, !11}
+!named = !{!0, !1, !2, !3, !4, !5, !6, !7}
+
+; CHECK: !0 = !{}
+; CHECK-NEXT: !1 = !MDLocation(line: 3, column: 7, scope: !0)
+; CHECK-NEXT: !2 = !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !1)
+; CHECK-NEXT: !3 = !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !2)
+; CHECK-NEXT: !4 = distinct !{}
+; CHECK-NEXT: !5 = !MDLocation(line: 3, column: 7, scope: !4)
+; CHECK-NEXT: !6 = !MDLocation(line: 3, column: 7, scope: !4, inlinedAt: !5)
+; CHECK-NEXT: !7 = !MDLocation(line: 3, column: 7, scope: !4, inlinedAt: !6)
+; CHECK-NEXT: !8 = distinct !{}
+; CHECK-NEXT: !9 = !MDLocation(line: 3, column: 7, scope: !8)
+; CHECK-NEXT: !10 = !MDLocation(line: 3, column: 7, scope: !8, inlinedAt: !9)
+; CHECK-NEXT: !11 = !MDLocation(line: 3, column: 7, scope: !8, inlinedAt: !10)
+!0 = !{} ; Use this as a scope.
+!1 = !MDLocation(line: 3, column: 7, scope: !0)
+!2 = !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !1)
+!3 = !MDLocation(line: 3, column: 7, scope: !0, inlinedAt: !2)
+!4 = distinct !{} ; Test actual remapping.
+!5 = !MDLocation(line: 3, column: 7, scope: !4)
+!6 = !MDLocation(line: 3, column: 7, scope: !4, inlinedAt: !5)
+!7 = !MDLocation(line: 3, column: 7, scope: !4, inlinedAt: !6)
OpenPOWER on IntegriCloud