Rafael Espindola | d9f6e5d | 2015-03-11 01:08:32 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple i686-pc-cygwin -O2 %s -o - | FileCheck %s |
| 2 | ; Check struct X for dead variable xyz from inlined function foo. |
| 3 | |
| 4 | ; CHECK: Lsection_info |
| 5 | ; CHECK: DW_TAG_structure_type |
| 6 | ; CHECK-NEXT: info_string |
| 7 | |
| 8 | |
| 9 | @i = common global i32 0 ; <i32*> [#uses=2] |
| 10 | |
| 11 | declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone |
| 12 | |
| 13 | declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone |
| 14 | |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 15 | define i32 @bar() nounwind ssp !dbg !6 { |
Rafael Espindola | d9f6e5d | 2015-03-11 01:08:32 +0000 | [diff] [blame] | 16 | entry: |
| 17 | %0 = load i32, i32* @i, align 4, !dbg !17 ; <i32> [#uses=2] |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 18 | tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !109, metadata !DIExpression()), !dbg !19 |
| 19 | tail call void @llvm.dbg.declare(metadata !29, metadata !110, metadata !DIExpression()), !dbg !21 |
Rafael Espindola | d9f6e5d | 2015-03-11 01:08:32 +0000 | [diff] [blame] | 20 | %1 = mul nsw i32 %0, %0, !dbg !22 ; <i32> [#uses=2] |
| 21 | store i32 %1, i32* @i, align 4, !dbg !17 |
| 22 | ret i32 %1, !dbg !23 |
| 23 | } |
| 24 | |
| 25 | !llvm.dbg.cu = !{!2} |
| 26 | !llvm.module.flags = !{!28} |
| 27 | |
Duncan P. N. Exon Smith | 814b8e9 | 2015-08-28 20:26:49 +0000 | [diff] [blame] | 28 | !0 = distinct !DISubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 29 | !1 = !DIFile(filename: "bar.c", directory: "/tmp/") |
Duncan P. N. Exon Smith | 55ca964 | 2015-08-03 17:26:41 +0000 | [diff] [blame] | 30 | !2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 0, file: !27, enums: !20, retainedTypes: !20, subprograms: !25, globals: !26, imports: !20) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 31 | !3 = !DISubroutineType(types: !4) |
Rafael Espindola | d9f6e5d | 2015-03-11 01:08:32 +0000 | [diff] [blame] | 32 | !4 = !{!5, !5} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 33 | !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
Peter Collingbourne | d4bff30 | 2015-11-05 22:03:56 +0000 | [diff] [blame] | 34 | !6 = distinct !DISubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !27, scope: !1, type: !7) |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 35 | !7 = !DISubroutineType(types: !8) |
Rafael Espindola | d9f6e5d | 2015-03-11 01:08:32 +0000 | [diff] [blame] | 36 | !8 = !{!5} |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 37 | !9 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5) |
| 38 | !10 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12) |
Duncan P. N. Exon Smith | 81f522a | 2015-04-03 16:54:30 +0000 | [diff] [blame] | 39 | |
Duncan P. N. Exon Smith | ed013cd | 2015-07-31 18:58:39 +0000 | [diff] [blame] | 40 | !109 = !DILocalVariable(name: "j", line: 9, arg: 1, scope: !0, file: !1, type: !5) |
| 41 | !110 = !DILocalVariable(name: "xyz", line: 10, scope: !11, file: !1, type: !12) |
Duncan P. N. Exon Smith | 81f522a | 2015-04-03 16:54:30 +0000 | [diff] [blame] | 42 | |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 43 | !11 = distinct !DILexicalBlock(line: 9, column: 0, file: !1, scope: !0) |
| 44 | !12 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13) |
Rafael Espindola | d9f6e5d | 2015-03-11 01:08:32 +0000 | [diff] [blame] | 45 | !13 = !{!14, !15} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 46 | !14 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 10, size: 32, align: 32, file: !27, scope: !12, baseType: !5) |
| 47 | !15 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 10, size: 32, align: 32, offset: 32, file: !27, scope: !12, baseType: !5) |
| 48 | !16 = !DIGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5, variable: i32* @i) |
| 49 | !17 = !DILocation(line: 15, scope: !18) |
| 50 | !18 = distinct !DILexicalBlock(line: 14, column: 0, file: !1, scope: !6) |
| 51 | !19 = !DILocation(line: 9, scope: !0, inlinedAt: !17) |
Rafael Espindola | d9f6e5d | 2015-03-11 01:08:32 +0000 | [diff] [blame] | 52 | !20 = !{} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 53 | !21 = !DILocation(line: 9, scope: !11, inlinedAt: !17) |
| 54 | !22 = !DILocation(line: 11, scope: !11, inlinedAt: !17) |
| 55 | !23 = !DILocation(line: 16, scope: !18) |
Rafael Espindola | d9f6e5d | 2015-03-11 01:08:32 +0000 | [diff] [blame] | 56 | !24 = !{!9, !10} |
| 57 | !25 = !{!0, !6} |
| 58 | !26 = !{!16} |
Duncan P. N. Exon Smith | a9308c4 | 2015-04-29 16:38:44 +0000 | [diff] [blame] | 59 | !27 = !DIFile(filename: "bar.c", directory: "/tmp/") |
Rafael Espindola | d9f6e5d | 2015-03-11 01:08:32 +0000 | [diff] [blame] | 60 | !28 = !{i32 1, !"Debug Info Version", i32 3} |
| 61 | !29 = !{null} |