1 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu %s -o %t -filetype=obj
2 ; RUN: llvm-dwarfdump %t | FileCheck %s
4 ; CHECK: 0x0000000b: DW_TAG_compile_unit
5 ; CHECK: 0x00000012: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000035] = "foo.cpp")
6 ; CHECK: 0x0000003c: DW_TAG_class_type
7 ; CHECK: 0x0000003d: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000006d] = "D")
8 ; CHECK: 0x00000044: DW_TAG_member
9 ; CHECK: 0x00000045: DW_AT_name [DW_FORM_strp] ( .debug_str[0x0000005d] = "c1")
11 %class.D = type { i32, i32, i32, i32 }
13 @_ZN1DC1Ev = alias void (%class.D*)* @_ZN1DC2Ev
14 @_ZN1DC1ERKS_ = alias void (%class.D*, %class.D*)* @_ZN1DC2ERKS_
16 define void @_ZN1DC2Ev(%class.D* nocapture %this) unnamed_addr nounwind uwtable align 2 {
18 tail call void @llvm.dbg.value(metadata !{%class.D* %this}, i64 0, metadata !29), !dbg !36
19 %c1 = getelementptr inbounds %class.D* %this, i64 0, i32 0, !dbg !37
20 store i32 1, i32* %c1, align 4, !dbg !37, !tbaa !39
21 %c2 = getelementptr inbounds %class.D* %this, i64 0, i32 1, !dbg !42
22 store i32 2, i32* %c2, align 4, !dbg !42, !tbaa !39
23 %c3 = getelementptr inbounds %class.D* %this, i64 0, i32 2, !dbg !43
24 store i32 3, i32* %c3, align 4, !dbg !43, !tbaa !39
25 %c4 = getelementptr inbounds %class.D* %this, i64 0, i32 3, !dbg !44
26 store i32 4, i32* %c4, align 4, !dbg !44, !tbaa !39
30 define void @_ZN1DC2ERKS_(%class.D* nocapture %this, %class.D* nocapture %d) unnamed_addr nounwind uwtable align 2 {
32 tail call void @llvm.dbg.value(metadata !{%class.D* %this}, i64 0, metadata !34), !dbg !46
33 tail call void @llvm.dbg.value(metadata !{%class.D* %d}, i64 0, metadata !35), !dbg !46
34 %c1 = getelementptr inbounds %class.D* %d, i64 0, i32 0, !dbg !47
35 %0 = load i32* %c1, align 4, !dbg !47, !tbaa !39
36 %c12 = getelementptr inbounds %class.D* %this, i64 0, i32 0, !dbg !47
37 store i32 %0, i32* %c12, align 4, !dbg !47, !tbaa !39
38 %c2 = getelementptr inbounds %class.D* %d, i64 0, i32 1, !dbg !49
39 %1 = load i32* %c2, align 4, !dbg !49, !tbaa !39
40 %c23 = getelementptr inbounds %class.D* %this, i64 0, i32 1, !dbg !49
41 store i32 %1, i32* %c23, align 4, !dbg !49, !tbaa !39
42 %c3 = getelementptr inbounds %class.D* %d, i64 0, i32 2, !dbg !50
43 %2 = load i32* %c3, align 4, !dbg !50, !tbaa !39
44 %c34 = getelementptr inbounds %class.D* %this, i64 0, i32 2, !dbg !50
45 store i32 %2, i32* %c34, align 4, !dbg !50, !tbaa !39
46 %c4 = getelementptr inbounds %class.D* %d, i64 0, i32 3, !dbg !51
47 %3 = load i32* %c4, align 4, !dbg !51, !tbaa !39
48 %c45 = getelementptr inbounds %class.D* %this, i64 0, i32 3, !dbg !51
49 store i32 %3, i32* %c45, align 4, !dbg !51, !tbaa !39
53 declare void @llvm.dbg.value(metadata, i64, metadata) nounwind readnone
57 !0 = metadata !{i32 786449, i32 0, i32 4, metadata !"foo.cpp", metadata !"/usr/local/google/home/echristo", metadata !"clang version 3.2 (trunk 167506) (llvm/trunk 167505)", i1 true, i1 true, metadata !"", i32 0, metadata !1, metadata !1, metadata !3, metadata !1} ; [ DW_TAG_compile_unit ] [/usr/local/google/home/echristo/foo.cpp] [DW_LANG_C_plus_plus]
58 !1 = metadata !{metadata !2}
59 !2 = metadata !{i32 0}
60 !3 = metadata !{metadata !4}
61 !4 = metadata !{metadata !5, metadata !31}
62 !5 = metadata !{i32 786478, i32 0, null, metadata !"D", metadata !"D", metadata !"_ZN1DC2Ev", metadata !6, i32 12, metadata !7, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 true, void (%class.D*)* @_ZN1DC2Ev, null, metadata !17, metadata !27, i32 12} ; [ DW_TAG_subprogram ] [line 12] [def] [D]
63 !6 = metadata !{i32 786473, metadata !"foo.cpp", metadata !"/usr/local/google/home/echristo", null} ; [ DW_TAG_file_type ]
64 !7 = metadata !{i32 786453, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !8, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
65 !8 = metadata !{null, metadata !9}
66 !9 = metadata !{i32 786447, i32 0, metadata !"", i32 0, i32 0, i64 64, i64 64, i64 0, i32 1088, metadata !10} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from D]
67 !10 = metadata !{i32 786434, null, metadata !"D", metadata !6, i32 1, i64 128, i64 32, i32 0, i32 0, null, metadata !11, i32 0, null, null} ; [ DW_TAG_class_type ] [D] [line 1, size 128, align 32, offset 0] [from ]
68 !11 = metadata !{metadata !12, metadata !14, metadata !15, metadata !16, metadata !17, metadata !20}
69 !12 = metadata !{i32 786445, metadata !10, metadata !"c1", metadata !6, i32 6, i64 32, i64 32, i64 0, i32 1, metadata !13} ; [ DW_TAG_member ] [c1] [line 6, size 32, align 32, offset 0] [private] [from int]
70 !13 = metadata !{i32 786468, null, metadata !"int", null, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
71 !14 = metadata !{i32 786445, metadata !10, metadata !"c2", metadata !6, i32 7, i64 32, i64 32, i64 32, i32 1, metadata !13} ; [ DW_TAG_member ] [c2] [line 7, size 32, align 32, offset 32] [private] [from int]
72 !15 = metadata !{i32 786445, metadata !10, metadata !"c3", metadata !6, i32 8, i64 32, i64 32, i64 64, i32 1, metadata !13} ; [ DW_TAG_member ] [c3] [line 8, size 32, align 32, offset 64] [private] [from int]
73 !16 = metadata !{i32 786445, metadata !10, metadata !"c4", metadata !6, i32 9, i64 32, i64 32, i64 96, i32 1, metadata !13} ; [ DW_TAG_member ] [c4] [line 9, size 32, align 32, offset 96] [private] [from int]
74 !17 = metadata !{i32 786478, i32 0, metadata !10, metadata !"D", metadata !"D", metadata !"", metadata !6, i32 3, metadata !7, i1 false, i1 false, i32 0, i32 0, null, i32 256, i1 true, null, null, i32 0, metadata !18, i32 3} ; [ DW_TAG_subprogram ] [line 3] [D]
75 !18 = metadata !{metadata !19}
76 !19 = metadata !{i32 786468} ; [ DW_TAG_base_type ] [line 0, size 0, align 0, offset 0]
77 !20 = metadata !{i32 786478, i32 0, metadata !10, metadata !"D", metadata !"D", metadata !"", metadata !6, i32 4, metadata !21, i1 false, i1 false, i32 0, i32 0, null, i32 256, i1 true, null, null, i32 0, metadata !25, i32 4} ; [ DW_TAG_subprogram ] [line 4] [D]
78 !21 = metadata !{i32 786453, i32 0, metadata !"", i32 0, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !22, i32 0, i32 0} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
79 !22 = metadata !{null, metadata !9, metadata !23}
80 !23 = metadata !{i32 786448, null, null, null, i32 0, i64 0, i64 0, i64 0, i32 0, metadata !24} ; [ DW_TAG_reference_type ] [line 0, size 0, align 0, offset 0] [from ]
81 !24 = metadata !{i32 786470, null, metadata !"", null, i32 0, i64 0, i64 0, i64 0, i32 0, metadata !10} ; [ DW_TAG_const_type ] [line 0, size 0, align 0, offset 0] [from D]
82 !25 = metadata !{metadata !26}
83 !26 = metadata !{i32 786468} ; [ DW_TAG_base_type ] [line 0, size 0, align 0, offset 0]
84 !27 = metadata !{metadata !28}
85 !28 = metadata !{metadata !29}
86 !29 = metadata !{i32 786689, metadata !5, metadata !"this", metadata !6, i32 16777228, metadata !30, i32 1088, i32 0} ; [ DW_TAG_arg_variable ] [this] [line 12]
87 !30 = metadata !{i32 786447, null, metadata !"", null, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !10} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [from D]
88 !31 = metadata !{i32 786478, i32 0, null, metadata !"D", metadata !"D", metadata !"_ZN1DC2ERKS_", metadata !6, i32 19, metadata !21, i1 false, i1 true, i32 0, i32 0, null, i32 256, i1 true, void (%class.D*, %class.D*)* @_ZN1DC2ERKS_, null, metadata !20, metadata !32, i32 19} ; [ DW_TAG_subprogram ] [line 19] [def] [D]
89 !32 = metadata !{metadata !33}
90 !33 = metadata !{metadata !34, metadata !35}
91 !34 = metadata !{i32 786689, metadata !31, metadata !"this", metadata !6, i32 16777235, metadata !30, i32 1088, i32 0} ; [ DW_TAG_arg_variable ] [this] [line 19]
92 !35 = metadata !{i32 786689, metadata !31, metadata !"d", metadata !6, i32 33554451, metadata !23, i32 0, i32 0} ; [ DW_TAG_arg_variable ] [d] [line 19]
93 !36 = metadata !{i32 12, i32 0, metadata !5, null}
94 !37 = metadata !{i32 13, i32 0, metadata !38, null}
95 !38 = metadata !{i32 786443, metadata !5, i32 12, i32 0, metadata !6, i32 0} ; [ DW_TAG_lexical_block ] [/usr/local/google/home/echristo/foo.cpp]
96 !39 = metadata !{metadata !"int", metadata !40}
97 !40 = metadata !{metadata !"omnipotent char", metadata !41}
98 !41 = metadata !{metadata !"Simple C/C++ TBAA"}
99 !42 = metadata !{i32 14, i32 0, metadata !38, null}
100 !43 = metadata !{i32 15, i32 0, metadata !38, null}
101 !44 = metadata !{i32 16, i32 0, metadata !38, null}
102 !45 = metadata !{i32 17, i32 0, metadata !38, null}
103 !46 = metadata !{i32 19, i32 0, metadata !31, null}
104 !47 = metadata !{i32 20, i32 0, metadata !48, null}
105 !48 = metadata !{i32 786443, metadata !31, i32 19, i32 0, metadata !6, i32 1} ; [ DW_TAG_lexical_block ] [/usr/local/google/home/echristo/foo.cpp]
106 !49 = metadata !{i32 21, i32 0, metadata !48, null}
107 !50 = metadata !{i32 22, i32 0, metadata !48, null}
108 !51 = metadata !{i32 23, i32 0, metadata !48, null}
109 !52 = metadata !{i32 24, i32 0, metadata !48, null}