llvm.org GIT mirror llvm / 763e186
DebugInfo: Fix testcases that fail -verify-debug-info=true As part of PR22777, fix testcases that fail the debug info verifier. The changes fall into the following categories: - Empty `filename:` fields in `MDFile`s. Compile units and some types require non-empty filenames. A number of testcases have empty filenames, probably due to hand-reduction of testcases. - Not-quite empty arrays: `!{i32 0}`. This used to be equivalent in the debug info schema to `!{}`. They cause problems for `!MDSubroutineType`'s `types:` array, since it requires all operands to be valid types. (Note that `!{null}` is the correct type array for functions that take no arguments and return `void`.) - Significantly bitrotted testcases. Nodes got left behind a few upgrades ago because of missing or invalid tags. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232415 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan P. N. Exon Smith 4 years ago
13 changed file(s) with 53 addition(s) and 56 deletion(s). Raw diff Collapse all Expand all
4747 !1 = !MDFile(filename: "test.c", directory: "")
4848 !2 = !{}
4949 !3 = !{!4}
50 !4 = !MDSubprogram(name: "", line: 140, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 141, file: !1, scope: !5, type: !6, function: void ()* @test, variables: !12)
51 !5 = !MDFile(filename: "test.c", directory: "")
50 !4 = !MDSubprogram(name: "", line: 140, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 141, file: !1, scope: !1, type: !6, function: void ()* @test, variables: !12)
5251 !6 = !MDSubroutineType(types: !7)
5352 !7 = !{null, !8}
5453 !8 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !9)
55 !9 = !MDDerivedType(tag: DW_TAG_typedef, line: 30, file: !10, baseType: !11)
56 !10 = !MDFile(filename: "", directory: "")
54 !9 = !MDDerivedType(tag: DW_TAG_typedef, line: 30, file: !1, baseType: !11)
5755 !11 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
5856 !12 = !{!13, !14, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31, !32, !33, !34, !35}
59 !13 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "", line: 140, arg: 1, scope: !4, file: !5, type: !8)
60 !14 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !5, type: !15)
61 !15 = !MDDerivedType(tag: DW_TAG_typedef, line: 183, file: !16, baseType: !17)
62 !16 = !MDFile(filename: "", directory: "")
57 !13 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "", line: 140, arg: 1, scope: !4, file: !1, type: !8)
58 !14 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !1, type: !15)
59 !15 = !MDDerivedType(tag: DW_TAG_typedef, line: 183, file: !1, baseType: !17)
6360 !17 = !MDBasicType(tag: DW_TAG_base_type, size: 64, align: 64, encoding: DW_ATE_signed)
64 !18 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !5, type: !15)
65 !19 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !5, type: !15)
66 !20 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !5, type: !15)
67 !21 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !5, type: !15)
68 !22 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !5, type: !15)
69 !23 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !5, type: !15)
70 !24 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !5, type: !15)
71 !25 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 143, scope: !4, file: !5, type: !15)
72 !26 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 143, scope: !4, file: !5, type: !15)
73 !27 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 143, scope: !4, file: !5, type: !15)
74 !28 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 143, scope: !4, file: !5, type: !15)
75 !29 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 144, scope: !4, file: !5, type: !15)
76 !30 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 144, scope: !4, file: !5, type: !15)
77 !31 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 144, scope: !4, file: !5, type: !15)
78 !32 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 144, scope: !4, file: !5, type: !15)
79 !33 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 144, scope: !4, file: !5, type: !15)
80 !34 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 145, scope: !4, file: !5, type: !8)
81 !35 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 146, scope: !4, file: !5, type: !11)
61 !18 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !1, type: !15)
62 !19 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !1, type: !15)
63 !20 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !1, type: !15)
64 !21 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !1, type: !15)
65 !22 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !1, type: !15)
66 !23 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !1, type: !15)
67 !24 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 142, scope: !4, file: !1, type: !15)
68 !25 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 143, scope: !4, file: !1, type: !15)
69 !26 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 143, scope: !4, file: !1, type: !15)
70 !27 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 143, scope: !4, file: !1, type: !15)
71 !28 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 143, scope: !4, file: !1, type: !15)
72 !29 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 144, scope: !4, file: !1, type: !15)
73 !30 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 144, scope: !4, file: !1, type: !15)
74 !31 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 144, scope: !4, file: !1, type: !15)
75 !32 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 144, scope: !4, file: !1, type: !15)
76 !33 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 144, scope: !4, file: !1, type: !15)
77 !34 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 145, scope: !4, file: !1, type: !8)
78 !35 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "", line: 146, scope: !4, file: !1, type: !11)
8279 !36 = !{i32 2, !"Dwarf Version", i32 4}
8380 !37 = !{i32 2, !"Debug Info Version", i32 3}
8481 !38 = !{!"clang version 3.6.0 "}
6161 !llvm.dbg.cu = !{!0}
6262 !llvm.module.flags = !{!22, !23}
6363
64 !0 = !{!"", !1, !2, !3, !12, !20, !2} ; [ DW_TAG_compile_unit ] [test.cpp] [DW_LANG_C_plus_plus]
64 !0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, file: !1, enums: !2, retainedTypes: !3, subprograms: !12, globals: !20, imports: !2)
6565 !1 = !MDFile(filename: "test.cpp", directory: "")
6666 !2 = !{}
6767 !3 = !{!4}
6868 !4 = !MDCompositeType(tag: DW_TAG_class_type, name: "C", line: 2, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS1C")
6969 !5 = !{!6}
70 !6 = !{!"", !1, !"_ZTS1C", !7, null, null, null, null, null} ; [ DW_TAG_subprogram ] [line 4] [public] [test]
71 !7 = !{!"", null, null, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ]
70 !6 = !MDSubprogram(name: "test", file: !1, scope: !"_ZTS1C", type: !7)
71 !7 = !MDSubroutineType(types: !8)
7272 !8 = !{!9, !10, !11, !11, !11, null}
73 !9 = !{!"", null, null} ; [ DW_TAG_base_type ] [int] [line 0, size 32, align 32, offset 0, enc DW_ATE_signed]
74 !10 = !{!"", null, null, !"_ZTS1C"} ; [ DW_TAG_pointer_type ] [line 0, size 64, align 64, offset 0] [artificial] [from _ZTS1C]
73 !9 = !MDBasicType(encoding: DW_ATE_signed, size: 32, align: 32, name: "int")
74 !10 = !MDDerivedType(baseType: !"_ZTS1C", tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial)
7575 !11 = !MDBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
7676 !12 = !{!13}
7777 !13 = !MDSubprogram(name: "test_with_debug", linkageName: "test_with_debug", line: 6, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 6, file: !1, scope: !14, type: !15, function: void ()* @test_with_debug, variables: !17)
1414 !llvm.module.flags = !{!11, !13}
1515
1616 !0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: " ", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2)
17 !1 = !MDFile(filename: "", directory: "")
17 !1 = !MDFile(filename: "file.c", directory: "")
1818 !2 = !{}
1919 !3 = !{!4}
20 !4 = !MDSubprogram(name: "", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !5, type: !6, function: i32 ()* null, variables: !2)
21 !5 = !MDFile(filename: "", directory: "")
20 !4 = !MDSubprogram(name: "", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !1, scope: !1, type: !6, function: i32 ()* null, variables: !2)
2221 !6 = !MDSubroutineType(types: !7)
2322 !7 = !{!8}
2423 !8 = !MDBasicType(tag: DW_TAG_base_type, size: 32, align: 32, encoding: DW_ATE_signed)
2524 !9 = !{!10}
26 !10 = !MDGlobalVariable(name: "i", linkageName: "_ZL1i", line: 1, isLocal: true, isDefinition: true, scope: null, file: !5, type: !8)
25 !10 = !MDGlobalVariable(name: "i", linkageName: "_ZL1i", line: 1, isLocal: true, isDefinition: true, scope: null, file: !1, type: !8)
2726 !11 = !{i32 2, !"Dwarf Version", i32 3}
2827 !13 = !{i32 1, !"Debug Info Version", i32 3}
55 ; CHECK-LABEL: f
66 ; CHECK: entsp 2
77 ; ...the prologue...
8 ; CHECK: .loc 1 2 0 prologue_end # :2:0
8 ; CHECK: .loc 1 2 0 prologue_end # test.c:2:0
99 ; CHECK: add r0, r0, 1
1010 ; CHECK: retsp 2
1111 define i32 @f(i32 %a) {
2323 !llvm.dbg.cu = !{!0}
2424 !llvm.module.flags = !{!9, !10}
2525 !0 = !MDCompileUnit(language: DW_LANG_C99, isOptimized: false, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
26 !1 = !MDFile(filename: "", directory: "")
26 !1 = !MDFile(filename: "test.c", directory: "")
2727 !2 = !{}
2828 !3 = !{!4}
29 !4 = !MDSubprogram(name: "f", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !5, type: !6, function: i32 (i32)* @f, variables: !2)
30 !5 = !MDFile(filename: "", directory: "")
29 !4 = !MDSubprogram(name: "f", line: 2, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !1, type: !6, function: i32 (i32)* @f, variables: !2)
3130 !6 = !MDSubroutineType(types: !7)
3231 !7 = !{!8, !8}
3332 !8 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
3433 !9 = !{i32 2, !"Dwarf Version", i32 4}
3534 !10 = !{i32 2, !"Debug Info Version", i32 3}
36 !11 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 2, arg: 1, scope: !4, file: !5, type: !8)
35 !11 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "a", line: 2, arg: 1, scope: !4, file: !1, type: !8)
3736 !12 = !MDLocation(line: 2, scope: !4)
3837
1212 !llvm.module.flags = !{!3, !4}
1313 !llvm.ident = !{!5}
1414
15 !0 = !{i32 786449, !1, i32 12, !"clang version 3.6.0 ", i1 false, !"", i32 0, !2, !2, !2, !2, !2, !"", i32 1} ; [ DW_TAG_compile_unit ] [/a/empty.c] [DW_LANG_C99]
16 !1 = !{!"empty.c", !"/a"}
15 !0 = !MDCompileUnit(file: !1, language: DW_LANG_C99, producer: "clang version 3.6.0 ", isOptimized: false, enums: !2, retainedTypes: !2, subprograms: !2, globals: !2, imports: !2, emissionKind: 1)
16 !1 = !MDFile(filename: "empty.c", directory: "/a")
1717 !2 = !{}
1818 !3 = !{i32 2, !"Dwarf Version", i32 4}
1919 !4 = !{i32 2, !"Debug Info Version", i32 3}
6161 !llvm.ident = !{!23}
6262
6363 !0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !3, subprograms: !16, globals: !2, imports: !2)
64 !1 = !MDFile(filename: "", directory: "")
64 !1 = !MDFile(filename: "debug-info-qualifiers.cpp", directory: "")
6565 !2 = !{}
6666 !3 = !{!4}
6767 !4 = !MDCompositeType(tag: DW_TAG_class_type, name: "A", line: 2, size: 8, align: 8, file: !5, elements: !6, identifier: "_ZTS1A")
5151
5252 !0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 (trunk 199750) (llvm/trunk 199751)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
5353 !1 = !MDFile(filename: "first-only.c", directory: ".")
54 !2 = !{i32 0}
54 !2 = !{}
5555 !3 = !{!4}
5656 !4 = !MDSubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void (i32)* @foo, variables: !2)
5757 !5 = !MDFile(filename: "first-only.c", directory: ".")
58 !6 = !MDSubroutineType(types: !2)
58 !6 = !MDSubroutineType(types: !{null})
5959 !7 = !{i32 2, !"Dwarf Version", i32 4}
6060 !8 = !{i32 1, !"Debug Info Version", i32 3}
6161 !9 = !{!"clang version 3.5 (trunk 199750) (llvm/trunk 199751)"}
5252
5353 !0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.5 (trunk 199750) (llvm/trunk 199751)", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
5454 !1 = !MDFile(filename: "multiple.c", directory: ".")
55 !2 = !{i32 0}
55 !2 = !{}
5656 !3 = !{!4}
5757 !4 = !MDSubprogram(name: "foo", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !5, type: !6, function: void (i32)* @foo, variables: !2)
5858 !5 = !MDFile(filename: "multiple.c", directory: ".")
59 !6 = !MDSubroutineType(types: !2)
59 !6 = !MDSubroutineType(types: !{null, !13})
60 !13 = !MDBasicType(encoding: DW_ATE_signed, name: "int", size: 32, align: 32)
6061 !7 = !{i32 2, !"Dwarf Version", i32 4}
6162 !8 = !{i32 1, !"Debug Info Version", i32 3}
6263 !9 = !{!"clang version 3.5 (trunk 199750) (llvm/trunk 199751)"}
2121 !0 = !{i32 2, !"Debug Info Version", i32 3}
2222 !1 = !MDLocation(line: 8, scope: !2)
2323 !2 = !MDSubprogram(name: "test", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, scope: null, function: void (i32**)* @test)
24 !3 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 2, file: null, subprograms: !4)
24 !3 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: false, emissionKind: 2, file: !5, subprograms: !4)
2525 !4 = !{!2}
26 !5 = !MDFile(filename: "test.c", directory: "")
244244 !llvm.dbg.cu = !{!0}
245245 !llvm.module.flags = !{!11, !13}
246246
247 !0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !9, imports: !2)
247 !0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
248248 !1 = !MDFile(filename: "test.c", directory: "/home/tmp")
249 !2 = !{i32 0}
249 !2 = !{}
250250 !3 = !{!4}
251251 !4 = !MDSubprogram(name: "test_within_limit", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !5, type: !6, function: i32 ()* @test_within_limit, variables: !2)
252252 !5 = !MDFile(filename: "test.c", directory: "/home/tmp")
1717
1818 !0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 176994)", isOptimized: false, emissionKind: 0, file: !11, enums: !3, retainedTypes: !3, subprograms: !4, globals: !3)
1919 !2 = !MDFile(filename: "version", directory: "/usr/local/google/home/nlewycky")
20 !3 = !{i32 0}
20 !3 = !{}
2121 !4 = !{!5}
2222 !5 = !MDSubprogram(name: "test", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !10, scope: !6, type: !7, function: void ()* @test, variables: !3)
2323 !6 = !MDFile(filename: "", directory: ".")
24 !7 = !MDSubroutineType(types: !3)
24 !7 = !MDSubroutineType(types: !{null})
2525 !8 = !MDLocation(line: 1, scope: !5)
2626 ;; !9 is added through the echo line at the top.
2727 !10 = !MDFile(filename: "", directory: ".")
4747 !llvm.ident = !{!5}
4848
4949 !0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !{}, globals: !2, imports: !2)
50 !1 = !MDFile(filename: "", directory: "")
51 !2 = !{i32 0}
50 !1 = !MDFile(filename: "test.c", directory: "")
51 !2 = !{}
5252 !3 = !{i32 2, !"Dwarf Version", i32 4}
5353 !4 = !{i32 1, !"Debug Info Version", i32 3}
5454 !5 = !{!""}
199199
200200 !0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5 ", isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
201201 !1 = !MDFile(filename: "propagate.cc", directory: ".")
202 !2 = !{i32 0}
202 !2 = !{}
203203 !3 = !{!4, !7}
204204 !4 = !MDSubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !5, type: !6, function: i64 (i32, i32, i64)* @_Z3fooiil, variables: !2)
205205 !5 = !MDFile(filename: "propagate.cc", directory: ".")
206 !6 = !MDSubroutineType(types: !2)
206 !6 = !MDSubroutineType(types: !{null})
207207 !7 = !MDSubprogram(name: "main", line: 24, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 24, file: !1, scope: !5, type: !6, function: i32 ()* @main, variables: !2)
208208 !8 = !{i32 2, !"Dwarf Version", i32 4}
209209 !9 = !{i32 1, !"Debug Info Version", i32 3}