aboutsummaryrefslogtreecommitdiffstats
path: root/test/DebugInfo
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-10-08 23:49:38 +0000
committerManman Ren <manman.ren@gmail.com>2013-10-08 23:49:38 +0000
commitb6f74f06682df931631b9ac3de945b72e526f64e (patch)
tree6655006ee980910371bf08fd98630f026be93674 /test/DebugInfo
parentc1e2b2582c151be5a819705f20f6a7167db90cfa (diff)
downloadexternal_llvm-b6f74f06682df931631b9ac3de945b72e526f64e.zip
external_llvm-b6f74f06682df931631b9ac3de945b72e526f64e.tar.gz
external_llvm-b6f74f06682df931631b9ac3de945b72e526f64e.tar.bz2
Debug Info: In DIBuilder, the context fields of a static member and a
typedef are updated to use DIScopeRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192254 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/DebugInfo')
-rw-r--r--test/DebugInfo/tu-composite.ll75
1 files changed, 48 insertions, 27 deletions
diff --git a/test/DebugInfo/tu-composite.ll b/test/DebugInfo/tu-composite.ll
index c5477f3..53961c6 100644
--- a/test/DebugInfo/tu-composite.ll
+++ b/test/DebugInfo/tu-composite.ll
@@ -7,10 +7,18 @@
; CHECK: [[SP:.*]]: DW_TAG_subprogram
; CHECK: DW_AT_containing_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE]]})
; CHECK: [[TYPE2:.*]]: DW_TAG_structure_type
+; CHECK: DW_TAG_structure_type
+; CHECK: DW_AT_name [DW_FORM_strp] {{.*}}= "D")
+; CHECK: DW_TAG_member
+; CHECK: DW_AT_name [DW_FORM_strp] {{.*}}= "a")
+; CHECK: DW_TAG_typedef
+; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE2]]})
+; CHECK: DW_AT_name [DW_FORM_strp] {{.*}}= "baz2")
; CHECK: DW_TAG_pointer_type
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE]]})
; CHECK: DW_TAG_typedef
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE2]]})
+; CHECK: DW_AT_name [DW_FORM_strp] {{.*}}= "baz")
; CHECK: DW_TAG_array_type
; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (cu + {{.*}} => {[[TYPE2]]})
; IR generated from clang -g with the following source:
@@ -22,9 +30,14 @@
;
; struct bar { };
; typedef bar baz;
+; struct D {
+; typedef bar baz2;
+; static int a;
+; };
; void test() {
; baz B;
; bar A[3];
+; D::baz2 B2;
; }
%struct.C = type { i32 (...)** }
@@ -40,9 +53,9 @@ define void @_ZN1C3fooEv(%struct.C* %this) unnamed_addr #0 align 2 {
entry:
%this.addr = alloca %struct.C*, align 8
store %struct.C* %this, %struct.C** %this.addr, align 8
- call void @llvm.dbg.declare(metadata !{%struct.C** %this.addr}, metadata !25), !dbg !27
+ call void @llvm.dbg.declare(metadata !{%struct.C** %this.addr}, metadata !28), !dbg !30
%this1 = load %struct.C** %this.addr
- ret void, !dbg !28
+ ret void, !dbg !31
}
; Function Attrs: nounwind readnone
@@ -53,21 +66,23 @@ define void @_Z4testv() #0 {
entry:
%B = alloca %struct.bar, align 1
%A = alloca [3 x %struct.bar], align 1
- call void @llvm.dbg.declare(metadata !{%struct.bar* %B}, metadata !29), !dbg !31
- call void @llvm.dbg.declare(metadata !{[3 x %struct.bar]* %A}, metadata !32), !dbg !36
- ret void, !dbg !37
+ %B2 = alloca %struct.bar, align 1
+ call void @llvm.dbg.declare(metadata !{%struct.bar* %B}, metadata !32), !dbg !34
+ call void @llvm.dbg.declare(metadata !{[3 x %struct.bar]* %A}, metadata !35), !dbg !39
+ call void @llvm.dbg.declare(metadata !{%struct.bar* %B2}, metadata !40), !dbg !42
+ ret void, !dbg !43
}
attributes #0 = { nounwind ssp uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
attributes #1 = { nounwind readnone }
!llvm.dbg.cu = !{!0}
-!llvm.module.flags = !{!24}
+!llvm.module.flags = !{!27}
-!0 = metadata !{i32 786449, metadata !1, i32 4, metadata !"clang version 3.4", i1 false, metadata !"", i32 0, metadata !2, metadata !3, metadata !19, metadata !2, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [tmp.cpp] [DW_LANG_C_plus_plus]
+!0 = metadata !{i32 786449, metadata !1, i32 4, metadata !"clang version 3.4", i1 false, metadata !"", i32 0, metadata !2, metadata !3, metadata !22, metadata !2, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [tmp.cpp] [DW_LANG_C_plus_plus]
!1 = metadata !{metadata !"tmp.cpp", metadata !"."}
!2 = metadata !{i32 0}
-!3 = metadata !{metadata !4, metadata !18}
+!3 = metadata !{metadata !4, metadata !18, metadata !19}
!4 = metadata !{i32 786451, metadata !1, null, metadata !"C", i32 1, i64 64, i64 64, i32 0, i32 0, null, metadata !5, i32 0, metadata !"_ZTS1C", null, metadata !"_ZTS1C"} ; [ DW_TAG_structure_type ] [C] [line 1, size 64, align 64, offset 0] [def] [from ]
!5 = metadata !{metadata !6, metadata !13}
!6 = metadata !{i32 786445, metadata !1, metadata !7, metadata !"_vptr$C", i32 0, i64 64, i64 0, i64 0, i32 64, metadata !8} ; [ DW_TAG_member ] [_vptr$C] [line 0, size 64, align 0, offset 0] [artificial] [from ]
@@ -83,22 +98,28 @@ attributes #1 = { nounwind readnone }
!16 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 64, i64 64, i64 0, i32 1088, metadata !"_ZTS1C"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1C]
!17 = metadata !{i32 786468}
!18 = metadata !{i32 786451, metadata !1, null, metadata !"bar", i32 7, i64 8, i64 8, i32 0, i32 0, null, metadata !2, i32 0, null, null, metadata !"_ZTS3bar"} ; [ DW_TAG_structure_type ] [bar] [line 7, size 8, align 8, offset 0] [def] [from ]
-!19 = metadata !{metadata !20, metadata !21}
-!20 = metadata !{i32 786478, metadata !1, null, metadata !"foo", metadata !"foo", metadata !"_ZN1C3fooEv", i32 4, metadata !14, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (%struct.C*)* @_ZN1C3fooEv, null, metadata !13, metadata !2, i32 4} ; [ DW_TAG_subprogram ] [line 4] [def] [foo]
-!21 = metadata !{i32 786478, metadata !1, metadata !7, metadata !"test", metadata !"test", metadata !"_Z4testv", i32 9, metadata !22, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @_Z4testv, null, null, metadata !2, i32 9} ; [ DW_TAG_subprogram ] [line 9] [def] [test]
-!22 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !23, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
-!23 = metadata !{null}
-!24 = metadata !{i32 2, metadata !"Dwarf Version", i32 2}
-!25 = metadata !{i32 786689, metadata !20, metadata !"this", null, i32 16777216, metadata !26, i32 1088, i32 0} ; [ DW_TAG_arg_variable ] [this] [line 0]
-!26 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 64, i64 64, i64 0, i32 0, metadata !"_ZTS1C"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from _ZTS1C]
-!27 = metadata !{i32 0, i32 0, metadata !20, null}
-!28 = metadata !{i32 5, i32 0, metadata !20, null}
-!29 = metadata !{i32 786688, metadata !21, metadata !"B", metadata !7, i32 10, metadata !30, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [B] [line 10]
-!30 = metadata !{i32 786454, metadata !1, null, metadata !"baz", i32 8, i64 0, i64 0, i64 0, i32 0, metadata !"_ZTS3bar"} ; [ DW_TAG_typedef ] [baz] [line 8, size 0, align 0, offset 0] [from _ZTS3bar]
-!31 = metadata !{i32 10, i32 0, metadata !21, null}
-!32 = metadata !{i32 786688, metadata !21, metadata !"A", metadata !7, i32 11, metadata !33, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [A] [line 11]
-!33 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 24, i64 8, i32 0, i32 0, metadata !"_ZTS3bar", metadata !34, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 24, align 8, offset 0] [from _ZTS3bar]
-!34 = metadata !{metadata !35}
-!35 = metadata !{i32 786465, i64 0, i64 3} ; [ DW_TAG_subrange_type ] [0, 2]
-!36 = metadata !{i32 11, i32 0, metadata !21, null}
-!37 = metadata !{i32 12, i32 0, metadata !21, null}
+!19 = metadata !{i32 786451, metadata !1, null, metadata !"D", i32 9, i64 8, i64 8, i32 0, i32 0, null, metadata !20, i32 0, null, null, metadata !"_ZTS1D"} ; [ DW_TAG_structure_type ] [D] [line 9, size 8, align 8, offset 0] [def] [from ]
+!20 = metadata !{metadata !21}
+!21 = metadata !{i32 786445, metadata !1, metadata !"_ZTS1D", metadata !"a", i32 11, i64 0, i64 0, i64 0, i32 4096, metadata !12, null} ; [ DW_TAG_member ] [a] [line 11, size 0, align 0, offset 0] [static] [from int]
+!22 = metadata !{metadata !23, metadata !24}
+!23 = metadata !{i32 786478, metadata !1, null, metadata !"foo", metadata !"foo", metadata !"_ZN1C3fooEv", i32 4, metadata !14, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void (%struct.C*)* @_ZN1C3fooEv, null, metadata !13, metadata !2, i32 4} ; [ DW_TAG_subprogram ] [line 4] [def] [foo]
+!24 = metadata !{i32 786478, metadata !1, metadata !7, metadata !"test", metadata !"test", metadata !"_Z4testv", i32 13, metadata !25, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 false, void ()* @_Z4testv, null, null, metadata !2, i32 13} ; [ DW_TAG_subprogram ] [line 13] [def] [test]
+!25 = metadata !{i32 786453, i32 0, null, metadata !"", i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !26, i32 0, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
+!26 = metadata !{null}
+!27 = metadata !{i32 2, metadata !"Dwarf Version", i32 2}
+!28 = metadata !{i32 786689, metadata !23, metadata !"this", null, i32 16777216, metadata !29, i32 1088, i32 0} ; [ DW_TAG_arg_variable ] [this] [line 0]
+!29 = metadata !{i32 786447, null, null, metadata !"", i32 0, i64 64, i64 64, i64 0, i32 0, metadata !"_ZTS1C"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from _ZTS1C]
+!30 = metadata !{i32 0, i32 0, metadata !23, null}
+!31 = metadata !{i32 5, i32 0, metadata !23, null}
+!32 = metadata !{i32 786688, metadata !24, metadata !"B", metadata !7, i32 14, metadata !33, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [B] [line 14]
+!33 = metadata !{i32 786454, metadata !1, null, metadata !"baz", i32 8, i64 0, i64 0, i64 0, i32 0, metadata !"_ZTS3bar"} ; [ DW_TAG_typedef ] [baz] [line 8, size 0, align 0, offset 0] [from _ZTS3bar]
+!34 = metadata !{i32 14, i32 0, metadata !24, null}
+!35 = metadata !{i32 786688, metadata !24, metadata !"A", metadata !7, i32 15, metadata !36, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [A] [line 15]
+!36 = metadata !{i32 786433, null, null, metadata !"", i32 0, i64 24, i64 8, i32 0, i32 0, metadata !"_ZTS3bar", metadata !37, i32 0, null, null, null} ; [ DW_TAG_array_type ] [line 0, size 24, align 8, offset 0] [from _ZTS3bar]
+!37 = metadata !{metadata !38}
+!38 = metadata !{i32 786465, i64 0, i64 3} ; [ DW_TAG_subrange_type ] [0, 2]
+!39 = metadata !{i32 15, i32 0, metadata !24, null}
+!40 = metadata !{i32 786688, metadata !24, metadata !"B2", metadata !7, i32 16, metadata !41, i32 0, i32 0} ; [ DW_TAG_auto_variable ] [B2] [line 16]
+!41 = metadata !{i32 786454, metadata !1, metadata !"_ZTS1D", metadata !"baz2", i32 10, i64 0, i64 0, i64 0, i32 0, metadata !"_ZTS3bar"} ; [ DW_TAG_typedef ] [baz2] [line 10, size 0, align 0, offset 0] [from _ZTS3bar]
+!42 = metadata !{i32 16, i32 0, metadata !24, null}
+!43 = metadata !{i32 17, i32 0, metadata !24, null}