Rafael Espindola | 9eb4ddc | 2015-03-11 12:48:24 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple mips-linux-gnu -O2 %s -o - | FileCheck %s |
| 2 | ; Check struct X for dead variable xyz from inlined function foo. |
| 3 | |
Simon Atanasyan | ec8dfb1 | 2017-03-10 08:22:20 +0000 | [diff] [blame] | 4 | ; CHECK: .section .debug_info,"",@0x7000001e |
Rafael Espindola | 9eb4ddc | 2015-03-11 12:48:24 +0000 | [diff] [blame] | 5 | ; CHECK: DW_TAG_structure_type |
| 6 | ; CHECK-NEXT: info_string |
| 7 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 8 | source_filename = "test/DebugInfo/Mips/InlinedFnLocalVar.ll" |
Rafael Espindola | 9eb4ddc | 2015-03-11 12:48:24 +0000 | [diff] [blame] | 9 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 10 | @i = common global i32 0, !dbg !0 |
Rafael Espindola | 9eb4ddc | 2015-03-11 12:48:24 +0000 | [diff] [blame] | 11 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 12 | ; Function Attrs: nounwind readnone |
| 13 | declare void @llvm.dbg.declare(metadata, metadata, metadata) #0 |
Rafael Espindola | 9eb4ddc | 2015-03-11 12:48:24 +0000 | [diff] [blame] | 14 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 15 | ; Function Attrs: nounwind readnone |
| 16 | declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #0 |
Rafael Espindola | 9eb4ddc | 2015-03-11 12:48:24 +0000 | [diff] [blame] | 17 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 18 | ; Function Attrs: nounwind ssp |
| 19 | define i32 @bar() #1 !dbg !8 { |
Rafael Espindola | 9eb4ddc | 2015-03-11 12:48:24 +0000 | [diff] [blame] | 20 | entry: |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 21 | %0 = load i32, i32* @i, align 4, !dbg !11 |
| 22 | tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !13, metadata !24), !dbg !25 |
| 23 | tail call void @llvm.dbg.declare(metadata !5, metadata !18, metadata !24), !dbg !26 |
| 24 | %1 = mul nsw i32 %0, %0, !dbg !27 |
| 25 | store i32 %1, i32* @i, align 4, !dbg !11 |
| 26 | ret i32 %1, !dbg !28 |
Rafael Espindola | 9eb4ddc | 2015-03-11 12:48:24 +0000 | [diff] [blame] | 27 | } |
| 28 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 29 | attributes #0 = { nounwind readnone } |
| 30 | attributes #1 = { nounwind ssp } |
Rafael Espindola | 9eb4ddc | 2015-03-11 12:48:24 +0000 | [diff] [blame] | 31 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 32 | !llvm.dbg.cu = !{!4} |
| 33 | !llvm.module.flags = !{!7} |
Duncan P. N. Exon Smith | 81f522a | 2015-04-03 16:54:30 +0000 | [diff] [blame] | 34 | |
Adrian Prantl | 1eadba1 | 2016-12-22 00:45:21 +0000 | [diff] [blame] | 35 | !0 = !DIGlobalVariableExpression(var: !1) |
| 36 | !1 = !DIGlobalVariable(name: "i", scope: !2, file: !2, line: 5, type: !3, isLocal: false, isDefinition: true) |
| 37 | !2 = !DIFile(filename: "bar.c", directory: "/tmp/") |
| 38 | !3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) |
| 39 | !4 = distinct !DICompileUnit(language: DW_LANG_C89, file: !2, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5) |
| 40 | !5 = !{} |
| 41 | !6 = !{!0} |
| 42 | !7 = !{i32 1, !"Debug Info Version", i32 3} |
| 43 | !8 = distinct !DISubprogram(name: "bar", linkageName: "bar", scope: !2, file: !2, line: 14, type: !9, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !4) |
| 44 | !9 = !DISubroutineType(types: !10) |
| 45 | !10 = !{!3} |
| 46 | !11 = !DILocation(line: 15, scope: !12) |
| 47 | !12 = distinct !DILexicalBlock(scope: !8, file: !2, line: 14) |
| 48 | !13 = !DILocalVariable(name: "j", arg: 1, scope: !14, file: !2, line: 9, type: !3) |
| 49 | !14 = distinct !DISubprogram(name: "foo", scope: !2, file: !2, line: 9, type: !15, isLocal: true, isDefinition: true, scopeLine: 9, virtualIndex: 6, isOptimized: true, unit: !4, variables: !17) |
| 50 | !15 = !DISubroutineType(types: !16) |
| 51 | !16 = !{!3, !3} |
| 52 | !17 = !{!13, !18} |
| 53 | !18 = !DILocalVariable(name: "xyz", scope: !19, file: !2, line: 10, type: !20) |
| 54 | !19 = distinct !DILexicalBlock(scope: !14, file: !2, line: 9) |
| 55 | !20 = !DICompositeType(tag: DW_TAG_structure_type, name: "X", scope: !14, file: !2, line: 10, size: 64, align: 32, elements: !21) |
| 56 | !21 = !{!22, !23} |
| 57 | !22 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !20, file: !2, line: 10, baseType: !3, size: 32, align: 32) |
| 58 | !23 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !20, file: !2, line: 10, baseType: !3, size: 32, align: 32, offset: 32) |
| 59 | !24 = !DIExpression() |
| 60 | !25 = !DILocation(line: 9, scope: !14, inlinedAt: !11) |
| 61 | !26 = !DILocation(line: 9, scope: !19, inlinedAt: !11) |
| 62 | !27 = !DILocation(line: 11, scope: !19, inlinedAt: !11) |
| 63 | !28 = !DILocation(line: 16, scope: !12) |
Duncan P. N. Exon Smith | 81f522a | 2015-04-03 16:54:30 +0000 | [diff] [blame] | 64 | |