summaryrefslogtreecommitdiffstats
path: root/llvm/test/Bitcode
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/Bitcode
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/Bitcode')
-rw-r--r--llvm/test/Bitcode/diglobalvariable-3.8.ll8
-rw-r--r--llvm/test/Bitcode/diglobalvariable-3.8.ll.bcbin0 -> 712 bytes
-rw-r--r--llvm/test/Bitcode/dityperefs-3.8.ll26
3 files changed, 22 insertions, 12 deletions
diff --git a/llvm/test/Bitcode/diglobalvariable-3.8.ll b/llvm/test/Bitcode/diglobalvariable-3.8.ll
new file mode 100644
index 00000000000..55b3f656c57
--- /dev/null
+++ b/llvm/test/Bitcode/diglobalvariable-3.8.ll
@@ -0,0 +1,8 @@
+; RUN: llvm-dis -o - %s.bc | FileCheck %s
+
+; CHECK: !0 = distinct !DIGlobalVariable(name: "a", scope: null, isLocal: false, isDefinition: true, expr: !1)
+; CHECK: !1 = !DIExpression(DW_OP_constu, 42, DW_OP_stack_value)
+
+!named = !{!0}
+
+!0 = distinct !DIGlobalVariable(name: "a", variable: i32 42)
diff --git a/llvm/test/Bitcode/diglobalvariable-3.8.ll.bc b/llvm/test/Bitcode/diglobalvariable-3.8.ll.bc
new file mode 100644
index 00000000000..bfecedd75d9
--- /dev/null
+++ b/llvm/test/Bitcode/diglobalvariable-3.8.ll.bc
Binary files differ
diff --git a/llvm/test/Bitcode/dityperefs-3.8.ll b/llvm/test/Bitcode/dityperefs-3.8.ll
index 6c953f28aba..2bbe1a81e68 100644
--- a/llvm/test/Bitcode/dityperefs-3.8.ll
+++ b/llvm/test/Bitcode/dityperefs-3.8.ll
@@ -4,20 +4,22 @@
; Establish a stable order.
!named = !{!0, !1, !2, !3, !4, !6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16}
-; CHECK: !0 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
+; CHECK: @G1 = global i32 0, !dbg !0
+
+; CHECK: !0 = !DIGlobalVariable(name: "G",{{.*}} type: !1,
; CHECK-NEXT: !1 = !DICompositeType(tag: DW_TAG_structure_type, name: "T1"{{.*}}, identifier: "T1")
-; CHECK-NEXT: !2 = !DICompositeType(tag: DW_TAG_structure_type, name: "T2", scope: !1{{.*}}, baseType: !1, vtableHolder: !1, identifier: "T2")
-; CHECK-NEXT: !3 = !DIDerivedType(tag: DW_TAG_member, name: "M1", scope: !1{{.*}}, baseType: !2)
-; CHECK-NEXT: !4 = !DISubroutineType(types: !5)
-; CHECK-NEXT: !5 = !{!1, !2}
-; CHECK-NEXT: !6 = !DISubprogram(scope: !1,{{.*}} containingType: !1{{[,)]}}
-; CHECK-NEXT: !7 = !DILocalVariable(name: "V1", scope: !6, type: !2)
-; CHECK-NEXT: !8 = !DIObjCProperty(name: "P1", type: !1)
-; CHECK-NEXT: !9 = !DITemplateTypeParameter(type: !1)
-; CHECK-NEXT: !10 = !DIGlobalVariable(name: "G",{{.*}} type: !1,{{.*}} variable: i32* @G1)
+; CHECK-NEXT: !2 = !DIFile(filename: "path/to/file", directory: "/path/to/dir")
+; CHECK-NEXT: !3 = !DICompositeType(tag: DW_TAG_structure_type, name: "T2", scope: !1{{.*}}, baseType: !1, vtableHolder: !1, identifier: "T2")
+; CHECK-NEXT: !4 = !DIDerivedType(tag: DW_TAG_member, name: "M1", scope: !1{{.*}}, baseType: !3)
+; CHECK-NEXT: !5 = !DISubroutineType(types: !6)
+; CHECK-NEXT: !6 = !{!1, !3}
+; CHECK-NEXT: !7 = !DISubprogram(scope: !1,{{.*}} containingType: !1{{[,)]}}
+; CHECK-NEXT: !8 = !DILocalVariable(name: "V1", scope: !7, type: !3)
+; CHECK-NEXT: !9 = !DIObjCProperty(name: "P1", type: !1)
+; CHECK-NEXT: !10 = !DITemplateTypeParameter(type: !1)
; CHECK-NEXT: !11 = !DITemplateValueParameter(type: !1, value: i32* @G1)
-; CHECK-NEXT: !12 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "T2", scope: !0, entity: !1)
-; CHECK-NEXT: !13 = !DICompositeType(tag: DW_TAG_structure_type, name: "T3", file: !0, elements: !14, identifier: "T3")
+; CHECK-NEXT: !12 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "T2", scope: !2, entity: !1)
+; CHECK-NEXT: !13 = !DICompositeType(tag: DW_TAG_structure_type, name: "T3", file: !2, elements: !14, identifier: "T3")
; CHECK-NEXT: !14 = !{!15}
; CHECK-NEXT: !15 = !DISubprogram(scope: !13,
; CHECK-NEXT: !16 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type,{{.*}} extraData: !13)
OpenPOWER on IntegriCloud