llvm.org GIT mirror llvm / d545f1a
Move test to X86-specific due to some IR invalid on other targets git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249489 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 5 years ago
2 changed file(s) with 95 addition(s) and 95 deletion(s). Raw diff Collapse all Expand all
+0
-95
test/DebugInfo/Generic/def-line.ll less more
None ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
3
4 ; Given the following source, ensure that the decl_line/file is correctly
5 ; emitted and omitted on definitions if it mismatches/matches the declaration
6
7 ; struct foo {
8 ; static void f1() {
9 ; }
10 ; static void f2();
11 ; static void f3();
12 ; };
13 ; void foo::f2() {
14 ; f1(); // just to ensure f1 is emitted
15 ; }
16 ; #line 1 "bar.cpp"
17 ; void foo::f3() {
18 ; }
19
20 ; Skip the declarations
21 ; CHECK: DW_TAG_subprogram
22 ; CHECK: DW_TAG_subprogram
23 ; CHECK: DW_TAG_subprogram
24
25 ; CHECK: DW_TAG_subprogram
26 ; CHECK-NOT: {{DW_TAG|NULL|DW_AT_decl_file}}
27 ; CHECK: DW_AT_decl_line {{.*}}7
28 ; CHECK-NOT: {{DW_TAG|NULL|DW_AT_decl_file}}
29 ; CHECK: DW_AT_specification {{.*}}f2
30 ; CHECK-NOT: {{DW_TAG|NULL|DW_AT_decl_file}}
31
32 ; CHECK: DW_TAG_subprogram
33 ; CHECK-NOT: {{DW_TAG|NULL|DW_AT_decl_line|DW_AT_decl_file}}
34 ; CHECK: DW_AT_specification {{.*}}f1
35
36 ; CHECK: DW_TAG_subprogram
37 ; CHECK-NOT: {{DW_TAG|NULL}}
38 ; CHECK: DW_AT_decl_file {{.*}}bar.cpp
39 ; CHECK-NOT: {{DW_TAG|NULL}}
40 ; CHECK: DW_AT_decl_line {{.*}}1
41 ; CHECK-NOT: {{DW_TAG|NULL}}
42 ; CHECK: DW_AT_specification {{.*}}f3
43
44 $_ZN3foo2f1Ev = comdat any
45
46 ; Function Attrs: uwtable
47 define void @_ZN3foo2f2Ev() #0 align 2 {
48 entry:
49 call void @_ZN3foo2f1Ev(), !dbg !19
50 ret void, !dbg !20
51 }
52
53 ; Function Attrs: nounwind uwtable
54 define linkonce_odr void @_ZN3foo2f1Ev() #1 comdat align 2 {
55 entry:
56 ret void, !dbg !21
57 }
58
59 ; Function Attrs: nounwind uwtable
60 define void @_ZN3foo2f3Ev() #1 align 2 {
61 entry:
62 ret void, !dbg !22
63 }
64
65 attributes #0 = { uwtable "disable-tail-calls"="false" "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" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
66 attributes #1 = { nounwind uwtable "disable-tail-calls"="false" "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" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
67
68 !llvm.dbg.cu = !{!0}
69 !llvm.module.flags = !{!16, !17}
70 !llvm.ident = !{!18}
71
72 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 249440) (llvm/trunk 249465)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !11)
73 !1 = !DIFile(filename: "def-line.cpp", directory: "/tmp/dbginfo")
74 !2 = !{}
75 !3 = !{!4}
76 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !1, line: 1, size: 8, align: 8, elements: !5, identifier: "_ZTS3foo")
77 !5 = !{!6, !9, !10}
78 !6 = !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", scope: !"_ZTS3foo", file: !1, line: 2, type: !7, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false)
79 !7 = !DISubroutineType(types: !8)
80 !8 = !{null}
81 !9 = !DISubprogram(name: "f2", linkageName: "_ZN3foo2f2Ev", scope: !"_ZTS3foo", file: !1, line: 4, type: !7, isLocal: false, isDefinition: false, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false)
82 !10 = !DISubprogram(name: "f3", linkageName: "_ZN3foo2f3Ev", scope: !"_ZTS3foo", file: !1, line: 5, type: !7, isLocal: false, isDefinition: false, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false)
83 !11 = !{!12, !13, !15}
84 !12 = distinct !DISubprogram(name: "f2", linkageName: "_ZN3foo2f2Ev", scope: !"_ZTS3foo", file: !1, line: 7, type: !7, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @_ZN3foo2f2Ev, declaration: !9, variables: !2)
85 !13 = distinct !DISubprogram(name: "f3", linkageName: "_ZN3foo2f3Ev", scope: !"_ZTS3foo", file: !14, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @_ZN3foo2f3Ev, declaration: !10, variables: !2)
86 !14 = !DIFile(filename: "bar.cpp", directory: "/tmp/dbginfo")
87 !15 = distinct !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", scope: !"_ZTS3foo", file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @_ZN3foo2f1Ev, declaration: !6, variables: !2)
88 !16 = !{i32 2, !"Dwarf Version", i32 4}
89 !17 = !{i32 2, !"Debug Info Version", i32 3}
90 !18 = !{!"clang version 3.8.0 (trunk 249440) (llvm/trunk 249465)"}
91 !19 = !DILocation(line: 8, column: 3, scope: !12)
92 !20 = !DILocation(line: 9, column: 1, scope: !12)
93 !21 = !DILocation(line: 3, column: 3, scope: !15)
94 !22 = !DILocation(line: 2, column: 1, scope: !13)
0 ; REQUIRES: object-emission
1
2 ; RUN: %llc_dwarf < %s -filetype=obj | llvm-dwarfdump -debug-dump=info - | FileCheck %s
3
4 ; Given the following source, ensure that the decl_line/file is correctly
5 ; emitted and omitted on definitions if it mismatches/matches the declaration
6
7 ; struct foo {
8 ; static void f1() {
9 ; }
10 ; static void f2();
11 ; static void f3();
12 ; };
13 ; void foo::f2() {
14 ; f1(); // just to ensure f1 is emitted
15 ; }
16 ; #line 1 "bar.cpp"
17 ; void foo::f3() {
18 ; }
19
20 ; Skip the declarations
21 ; CHECK: DW_TAG_subprogram
22 ; CHECK: DW_TAG_subprogram
23 ; CHECK: DW_TAG_subprogram
24
25 ; CHECK: DW_TAG_subprogram
26 ; CHECK-NOT: {{DW_TAG|NULL|DW_AT_decl_file}}
27 ; CHECK: DW_AT_decl_line {{.*}}7
28 ; CHECK-NOT: {{DW_TAG|NULL|DW_AT_decl_file}}
29 ; CHECK: DW_AT_specification {{.*}}f2
30 ; CHECK-NOT: {{DW_TAG|NULL|DW_AT_decl_file}}
31
32 ; CHECK: DW_TAG_subprogram
33 ; CHECK-NOT: {{DW_TAG|NULL|DW_AT_decl_line|DW_AT_decl_file}}
34 ; CHECK: DW_AT_specification {{.*}}f1
35
36 ; CHECK: DW_TAG_subprogram
37 ; CHECK-NOT: {{DW_TAG|NULL}}
38 ; CHECK: DW_AT_decl_file {{.*}}bar.cpp
39 ; CHECK-NOT: {{DW_TAG|NULL}}
40 ; CHECK: DW_AT_decl_line {{.*}}1
41 ; CHECK-NOT: {{DW_TAG|NULL}}
42 ; CHECK: DW_AT_specification {{.*}}f3
43
44 $_ZN3foo2f1Ev = comdat any
45
46 ; Function Attrs: uwtable
47 define void @_ZN3foo2f2Ev() #0 align 2 {
48 entry:
49 call void @_ZN3foo2f1Ev(), !dbg !19
50 ret void, !dbg !20
51 }
52
53 ; Function Attrs: nounwind uwtable
54 define linkonce_odr void @_ZN3foo2f1Ev() #1 comdat align 2 {
55 entry:
56 ret void, !dbg !21
57 }
58
59 ; Function Attrs: nounwind uwtable
60 define void @_ZN3foo2f3Ev() #1 align 2 {
61 entry:
62 ret void, !dbg !22
63 }
64
65 attributes #0 = { uwtable "disable-tail-calls"="false" "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" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
66 attributes #1 = { nounwind uwtable "disable-tail-calls"="false" "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" "target-cpu"="x86-64" "target-features"="+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
67
68 !llvm.dbg.cu = !{!0}
69 !llvm.module.flags = !{!16, !17}
70 !llvm.ident = !{!18}
71
72 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 249440) (llvm/trunk 249465)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !11)
73 !1 = !DIFile(filename: "def-line.cpp", directory: "/tmp/dbginfo")
74 !2 = !{}
75 !3 = !{!4}
76 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", file: !1, line: 1, size: 8, align: 8, elements: !5, identifier: "_ZTS3foo")
77 !5 = !{!6, !9, !10}
78 !6 = !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", scope: !"_ZTS3foo", file: !1, line: 2, type: !7, isLocal: false, isDefinition: false, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false)
79 !7 = !DISubroutineType(types: !8)
80 !8 = !{null}
81 !9 = !DISubprogram(name: "f2", linkageName: "_ZN3foo2f2Ev", scope: !"_ZTS3foo", file: !1, line: 4, type: !7, isLocal: false, isDefinition: false, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false)
82 !10 = !DISubprogram(name: "f3", linkageName: "_ZN3foo2f3Ev", scope: !"_ZTS3foo", file: !1, line: 5, type: !7, isLocal: false, isDefinition: false, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false)
83 !11 = !{!12, !13, !15}
84 !12 = distinct !DISubprogram(name: "f2", linkageName: "_ZN3foo2f2Ev", scope: !"_ZTS3foo", file: !1, line: 7, type: !7, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @_ZN3foo2f2Ev, declaration: !9, variables: !2)
85 !13 = distinct !DISubprogram(name: "f3", linkageName: "_ZN3foo2f3Ev", scope: !"_ZTS3foo", file: !14, line: 1, type: !7, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @_ZN3foo2f3Ev, declaration: !10, variables: !2)
86 !14 = !DIFile(filename: "bar.cpp", directory: "/tmp/dbginfo")
87 !15 = distinct !DISubprogram(name: "f1", linkageName: "_ZN3foo2f1Ev", scope: !"_ZTS3foo", file: !1, line: 2, type: !7, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, function: void ()* @_ZN3foo2f1Ev, declaration: !6, variables: !2)
88 !16 = !{i32 2, !"Dwarf Version", i32 4}
89 !17 = !{i32 2, !"Debug Info Version", i32 3}
90 !18 = !{!"clang version 3.8.0 (trunk 249440) (llvm/trunk 249465)"}
91 !19 = !DILocation(line: 8, column: 3, scope: !12)
92 !20 = !DILocation(line: 9, column: 1, scope: !12)
93 !21 = !DILocation(line: 3, column: 3, scope: !15)
94 !22 = !DILocation(line: 2, column: 1, scope: !13)