summaryrefslogtreecommitdiff
path: root/test/DebugInfo
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2012-03-15 23:55:40 +0000
committerEric Christopher <echristo@apple.com>2012-03-15 23:55:40 +0000
commit2125d5a7e58eb21f34c2a21913d6f1074c63b5cd (patch)
tree1bba7e7c0e7e04ad6c2d66a8d9cff31d54d59990 /test/DebugInfo
parent89eaa6f554c362799a86ca50bdbaab72402565d2 (diff)
downloadllvm-2125d5a7e58eb21f34c2a21913d6f1074c63b5cd.tar.gz
llvm-2125d5a7e58eb21f34c2a21913d6f1074c63b5cd.tar.bz2
llvm-2125d5a7e58eb21f34c2a21913d6f1074c63b5cd.tar.xz
For types with a parent of the compile unit make sure and emit
the DECL information. rdar://10855921 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152876 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/DebugInfo')
-rw-r--r--test/DebugInfo/X86/DW_AT_specification.ll4
-rw-r--r--test/DebugInfo/X86/concrete_out_of_line.ll6
-rw-r--r--test/DebugInfo/X86/pr11300.ll4
-rw-r--r--test/DebugInfo/struct-loc.ll26
4 files changed, 33 insertions, 7 deletions
diff --git a/test/DebugInfo/X86/DW_AT_specification.ll b/test/DebugInfo/X86/DW_AT_specification.ll
index e4c5c807bf..078b740a41 100644
--- a/test/DebugInfo/X86/DW_AT_specification.ll
+++ b/test/DebugInfo/X86/DW_AT_specification.ll
@@ -3,8 +3,8 @@
; test that the DW_AT_specification is a back edge in the file.
-; CHECK: 0x00000038: DW_TAG_subprogram [5] *
-; CHECK: 0x0000005e: DW_AT_specification [DW_FORM_ref4] (cu + 0x0038 => {0x00000038})
+; CHECK: 0x0000003a: DW_TAG_subprogram [5] *
+; CHECK: 0x00000060: DW_AT_specification [DW_FORM_ref4] (cu + 0x003a => {0x0000003a})
@_ZZN3foo3barEvE1x = constant i32 0, align 4
diff --git a/test/DebugInfo/X86/concrete_out_of_line.ll b/test/DebugInfo/X86/concrete_out_of_line.ll
index 055a9bf034..a22707189b 100644
--- a/test/DebugInfo/X86/concrete_out_of_line.ll
+++ b/test/DebugInfo/X86/concrete_out_of_line.ll
@@ -7,7 +7,7 @@
; first check that we have a TAG_subprogram at a given offset and it has
; AT_inline.
-; CHECK: 0x00000130: DW_TAG_subprogram [18]
+; CHECK: 0x00000134: DW_TAG_subprogram [18]
; CHECK-NEXT: DW_AT_MIPS_linkage_name
; CHECK-NEXT: DW_AT_specification
; CHECK-NEXT: DW_AT_inline
@@ -15,8 +15,8 @@
; and then that a TAG_subprogram refers to it with AT_abstract_origin.
-; CHECK: 0x00000180: DW_TAG_subprogram [20]
-; CHECK-NEXT: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0130 => {0x00000130})
+; CHECK: 0x00000184: DW_TAG_subprogram [20]
+; CHECK-NEXT: DW_AT_abstract_origin [DW_FORM_ref4] (cu + 0x0134 => {0x00000134})
define i32 @_ZN17nsAutoRefCnt7ReleaseEv() {
entry:
diff --git a/test/DebugInfo/X86/pr11300.ll b/test/DebugInfo/X86/pr11300.ll
index 84884348e2..5a001eea75 100644
--- a/test/DebugInfo/X86/pr11300.ll
+++ b/test/DebugInfo/X86/pr11300.ll
@@ -3,8 +3,8 @@
; test that the DW_AT_specification is a back edge in the file.
-; CHECK: 0x0000005a: DW_TAG_subprogram [5]
-; CHECK: 0x0000007a: DW_AT_specification [DW_FORM_ref4] (cu + 0x005a => {0x0000005a})
+; CHECK: 0x0000005c: DW_TAG_subprogram [5]
+; CHECK: 0x0000007c: DW_AT_specification [DW_FORM_ref4] (cu + 0x005c => {0x0000005c})
%struct.foo = type { i8 }
diff --git a/test/DebugInfo/struct-loc.ll b/test/DebugInfo/struct-loc.ll
new file mode 100644
index 0000000000..9a04738820
--- /dev/null
+++ b/test/DebugInfo/struct-loc.ll
@@ -0,0 +1,26 @@
+; RUN: llc -mtriple=x86_64-apple-darwin %s -o %t -filetype=obj
+; RUN: llvm-dwarfdump %t | FileCheck %s
+
+; Make sure that structures have a decl file and decl line attached.
+; CHECK: DW_TAG_structure_type [3]
+; CHECK: DW_AT_decl_file
+; CHECK: DW_AT_decl_line
+; CHECK: DW_TAG_member
+
+%struct.foo = type { i32 }
+
+@f = common global %struct.foo zeroinitializer, align 4
+
+!llvm.dbg.cu = !{!0}
+
+!0 = metadata !{i32 786449, i32 0, i32 12, metadata !"struct_bug.c", metadata !"/Users/echristo/tmp", metadata !"clang version 3.1 (trunk 152837) (llvm/trunk 152845)", i1 true, i1 false, metadata !"", i32 0, metadata !1, metadata !1, metadata !1, metadata !3} ; [ DW_TAG_compile_unit ]
+!1 = metadata !{metadata !2}
+!2 = metadata !{i32 0}
+!3 = metadata !{metadata !4}
+!4 = metadata !{metadata !5}
+!5 = metadata !{i32 786484, i32 0, null, metadata !"f", metadata !"f", metadata !"", metadata !6, i32 5, metadata !7, i32 0, i32 1, %struct.foo* @f} ; [ DW_TAG_variable ]
+!6 = metadata !{i32 786473, metadata !"struct_bug.c", metadata !"/Users/echristo/tmp", null} ; [ DW_TAG_file_type ]
+!7 = metadata !{i32 786451, null, metadata !"foo", metadata !6, i32 1, i64 32, i64 32, i32 0, i32 0, null, metadata !8, i32 0, i32 0} ; [ DW_TAG_structure_type ]
+!8 = metadata !{metadata !9}
+!9 = metadata !{i32 786445, metadata !7, metadata !"a", metadata !6, i32 2, i64 32, i64 32, i64 0, i32 0, metadata !10} ; [ DW_TAG_member ]
+!10 = metadata !{i32 786468, null, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]