Eric Christopher | 12a7155 | 2014-05-20 23:59:54 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=x86_64-linux-gnu %s -filetype=obj -o %t |
| 2 | ; RUN: llvm-dwarfdump %t | FileCheck %s |
| 3 | |
Eric Christopher | a6342c5 | 2014-05-21 00:02:50 +0000 | [diff] [blame] | 4 | ; Reconstruct this via clang and -O2. |
Eric Christopher | 12a7155 | 2014-05-20 23:59:54 +0000 | [diff] [blame] | 5 | ; static void foo() { |
| 6 | ; struct X { int a; int b; } xyz; |
| 7 | ; } |
| 8 | |
| 9 | ; int bar() { |
| 10 | ; foo(); |
| 11 | ; return 1; |
| 12 | ; } |
| 13 | |
| 14 | ; Check that we still have the structure type for X even though we're not |
| 15 | ; going to emit a low/high_pc for foo. |
| 16 | ; CHECK: DW_TAG_structure_type |
| 17 | |
| 18 | ; Function Attrs: nounwind readnone uwtable |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 19 | define i32 @bar() #0 !dbg !4 { |
Eric Christopher | 12a7155 | 2014-05-20 23:59:54 +0000 | [diff] [blame] | 20 | entry: |
| 21 | ret i32 1, !dbg !21 |
| 22 | } |
| 23 | |
| 24 | attributes #0 = { nounwind readnone uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 25 | |
| 26 | !llvm.dbg.cu = !{!0} |
| 27 | !llvm.module.flags = !{!18, !19} |
| 28 | !llvm.ident = !{!20} |
| 29 | |
Duncan P. N. Exon Smith | 55ca964 | 2015-08-03 17:26:41 +0000 | [diff] [blame] | 30 | !0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (trunk 209255) (llvm/trunk 209253)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 31 | !1 = !DIFile(filename: "debug-dead-local-var.c", directory: "/usr/local/google/home/echristo") |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 32 | !2 = !{} |
| 33 | !3 = !{!4, !9} |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 34 | !4 = distinct !DISubprogram(name: "bar", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 11, file: !1, scope: !5, type: !6, variables: !2) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 35 | !5 = !DIFile(filename: "debug-dead-local-var.c", directory: "/usr/local/google/home/echristo") |
| 36 | !6 = !DISubroutineType(types: !7) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 37 | !7 = !{!8} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 38 | !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
Duncan P. N. Exon Smith | 814b8e9 | 2015-08-28 20:26:49 +0000 | [diff] [blame] | 39 | !9 = distinct !DISubprogram(name: "foo", line: 6, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 6, file: !1, scope: !5, type: !10, variables: !12) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 40 | !10 = !DISubroutineType(types: !11) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 41 | !11 = !{null} |
| 42 | !12 = !{!13} |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 43 | !13 = !DILocalVariable(name: "xyz", line: 8, scope: !9, file: !5, type: !14) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 44 | !14 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 8, size: 64, align: 32, file: !1, scope: !9, elements: !15) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 45 | !15 = !{!16, !17} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 46 | !16 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 8, size: 32, align: 32, file: !1, scope: !14, baseType: !8) |
| 47 | !17 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 8, size: 32, align: 32, offset: 32, file: !1, scope: !14, baseType: !8) |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 48 | !18 = !{i32 2, !"Dwarf Version", i32 4} |
Duncan P. N. Exon Smith | e274180 | 2015-03-03 17:24:31 +0000 | [diff] [blame] | 49 | !19 = !{i32 2, !"Debug Info Version", i32 3} |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 50 | !20 = !{!"clang version 3.5.0 (trunk 209255) (llvm/trunk 209253)"} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 51 | !21 = !DILocation(line: 13, scope: !4) |