summaryrefslogtreecommitdiffstats
path: root/llvm/test/Linker
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2016-09-13 01:12:59 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2016-09-13 01:12:59 +0000
commitd4135bbc30de3d3dbd44d64d718fb2169f41bae0 (patch)
tree0b96e34c50822aed89a2272d9e9f3688bc3a0e46 /llvm/test/Linker
parentefc066758309683482edd289d82ec7670d38931f (diff)
downloadbcm5719-llvm-d4135bbc30de3d3dbd44d64d718fb2169f41bae0.tar.gz
bcm5719-llvm-d4135bbc30de3d3dbd44d64d718fb2169f41bae0.zip
DebugInfo: New metadata representation for global variables.
This patch reverses the edge from DIGlobalVariable to GlobalVariable. This will allow us to more easily preserve debug info metadata when manipulating global variables. Fixes PR30362. A program for upgrading test cases is attached to that bug. Differential Revision: http://reviews.llvm.org/D20147 llvm-svn: 281284
Diffstat (limited to 'llvm/test/Linker')
-rw-r--r--llvm/test/Linker/2011-08-04-Metadata.ll13
-rw-r--r--llvm/test/Linker/2011-08-04-Metadata2.ll4
-rw-r--r--llvm/test/Linker/odr.ll4
-rw-r--r--llvm/test/Linker/only-needed-debug-metadata.ll8
4 files changed, 15 insertions, 14 deletions
diff --git a/llvm/test/Linker/2011-08-04-Metadata.ll b/llvm/test/Linker/2011-08-04-Metadata.ll
index dbc193af5b2..bbcc3fc7807 100644
--- a/llvm/test/Linker/2011-08-04-Metadata.ll
+++ b/llvm/test/Linker/2011-08-04-Metadata.ll
@@ -2,16 +2,17 @@
; RUN: llvm-dis < %t.bc | FileCheck %s
; Test if internal global variable's debug info is merged appropriately or not.
-; CHECK: !DIGlobalVariable(name: "x",
+; CHECK: @x = internal global i32 0, align 4, !dbg [[DI1:![0-9]+]]
+; CHECK: @x.1 = internal global i32 0, align 4, !dbg [[DI2:![0-9]+]]
+
+; CHECK: [[DI1]] = !DIGlobalVariable(name: "x",
; CHECK-NOT: linkageName:
-; CHECK-SAME: variable: i32* @x{{[,)]}}
-; CHECK: !DIGlobalVariable(name: "x",
+; CHECK: [[DI2]] = !DIGlobalVariable(name: "x",
; CHECK-NOT: linkageName:
-; CHECK-SAME: variable: i32* @x.1{{[,)]}}
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-macosx10.7.0"
-@x = internal global i32 0, align 4
+@x = internal global i32 0, align 4, !dbg !5
define void @foo() nounwind uwtable ssp !dbg !1 {
entry:
@@ -27,7 +28,7 @@ entry:
!2 = !DIFile(filename: "/tmp/one.c", directory: "/Volumes/Lalgate/Slate/D")
!3 = !DISubroutineType(types: !4)
!4 = !{null}
-!5 = !DIGlobalVariable(name: "x", line: 2, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !6, variable: i32* @x)
+!5 = !DIGlobalVariable(name: "x", line: 2, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !6)
!6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!7 = !DILocation(line: 3, column: 14, scope: !8)
!8 = distinct !DILexicalBlock(line: 3, column: 12, file: !9, scope: !1)
diff --git a/llvm/test/Linker/2011-08-04-Metadata2.ll b/llvm/test/Linker/2011-08-04-Metadata2.ll
index 12b0d4387fe..f15a8414089 100644
--- a/llvm/test/Linker/2011-08-04-Metadata2.ll
+++ b/llvm/test/Linker/2011-08-04-Metadata2.ll
@@ -6,7 +6,7 @@
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-apple-macosx10.7.0"
-@x = internal global i32 0, align 4
+@x = internal global i32 0, align 4, !dbg !5
define void @bar() nounwind uwtable ssp !dbg !1 {
entry:
@@ -22,7 +22,7 @@ entry:
!2 = !DIFile(filename: "/tmp/two.c", directory: "/Volumes/Lalgate/Slate/D")
!3 = !DISubroutineType(types: !4)
!4 = !{null}
-!5 = !DIGlobalVariable(name: "x", line: 1, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !6, variable: i32* @x)
+!5 = !DIGlobalVariable(name: "x", line: 1, isLocal: true, isDefinition: true, scope: !0, file: !2, type: !6)
!6 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!7 = !DILocation(line: 2, column: 14, scope: !8)
!8 = distinct !DILexicalBlock(line: 2, column: 12, file: !9, scope: !1)
diff --git a/llvm/test/Linker/odr.ll b/llvm/test/Linker/odr.ll
index db54995e7a4..a3ca855fa5f 100644
--- a/llvm/test/Linker/odr.ll
+++ b/llvm/test/Linker/odr.ll
@@ -3,7 +3,7 @@
; RUN: llvm-as %p/Inputs/odr.ll -o %t2.bc
; Check that we can link it
; RUN: llvm-link %t1.bc %t2.bc -o %t
-@bar = global i64 0, align 8
+@bar = global i64 0, align 8, !dbg !6
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!7}
@@ -14,5 +14,5 @@
!3 = distinct !DICompositeType(tag: DW_TAG_class_type, scope: !4, file: !1, identifier: "zed")
!4 = distinct !DISubprogram(name: "b", scope: null, isLocal: false, isDefinition: true, isOptimized: false, unit: !0)
!5 = !{!6}
-!6 = distinct !DIGlobalVariable(name: "c", scope: null, isLocal: false, isDefinition: true, variable: i64* @bar)
+!6 = distinct !DIGlobalVariable(name: "c", scope: null, isLocal: false, isDefinition: true)
!7 = !{i32 2, !"Debug Info Version", i32 3}
diff --git a/llvm/test/Linker/only-needed-debug-metadata.ll b/llvm/test/Linker/only-needed-debug-metadata.ll
index 2f8858e4c6e..2d1949fb0ec 100644
--- a/llvm/test/Linker/only-needed-debug-metadata.ll
+++ b/llvm/test/Linker/only-needed-debug-metadata.ll
@@ -11,8 +11,8 @@
; ONLYNEEDED: distinct !DISubprogram(name: "foo"
; ONLYNEEDED-NOT: distinct !DISubprogram(name: "unused"
-@X = global i32 5
-@U = global i32 6
+@X = global i32 5, !dbg !14
+@U = global i32 6, !dbg !15
@U_linkonce = linkonce_odr hidden global i32 6
define i32 @foo() !dbg !4 {
ret i32 7, !dbg !20
@@ -38,8 +38,8 @@ define i32 @unused() !dbg !10 {
!11 = !DISubroutineType(types: !12)
!12 = !{!7}
!13 = !{!14, !15}
-!14 = !DIGlobalVariable(name: "X", scope: !0, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true, variable: i32* @X)
-!15 = !DIGlobalVariable(name: "U", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, variable: i32* @U)
+!14 = !DIGlobalVariable(name: "X", scope: !0, file: !1, line: 1, type: !7, isLocal: false, isDefinition: true)
+!15 = !DIGlobalVariable(name: "U", scope: !0, file: !1, line: 2, type: !7, isLocal: false, isDefinition: true)
!16 = !{i32 2, !"Dwarf Version", i32 4}
!17 = !{i32 2, !"Debug Info Version", i32 3}
!18 = !{!"clang version 3.8.0 (trunk 251407) (llvm/trunk 251401)"}
OpenPOWER on IntegriCloud