1 ; RUN: llc -mtriple mips-linux-gnu -O2 %s -o - | FileCheck %s
2 ; Check struct X for dead variable xyz from inlined function foo.
5 ; CHECK: DW_TAG_structure_type
6 ; CHECK-NEXT: info_string
9 @i = common global i32 0 ; <i32*> [#uses=2]
11 declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
13 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
15 define i32 @bar() nounwind ssp {
17 %0 = load i32, i32* @i, align 4, !dbg !17 ; <i32> [#uses=2]
18 tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !9, metadata !MDExpression()), !dbg !19
19 tail call void @llvm.dbg.declare(metadata !29, metadata !10, metadata !MDExpression()), !dbg !21
20 %1 = mul nsw i32 %0, %0, !dbg !22 ; <i32> [#uses=2]
21 store i32 %1, i32* @i, align 4, !dbg !17
26 !llvm.module.flags = !{!28}
28 !0 = !MDSubprogram(name: "foo", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 9, file: !27, scope: !1, type: !3, variables: !24)
29 !1 = !MDFile(filename: "bar.c", directory: "/tmp/")
30 !2 = !MDCompileUnit(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)
31 !3 = !MDSubroutineType(types: !4)
33 !5 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
34 !6 = !MDSubprogram(name: "bar", linkageName: "bar", line: 14, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !27, scope: !1, type: !7, function: i32 ()* @bar)
35 !7 = !MDSubroutineType(types: !8)
37 !9 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "j", line: 9, arg: 0, scope: !0, file: !1, type: !5)
38 !10 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "xyz", line: 10, scope: !11, file: !1, type: !12)
39 !11 = distinct !MDLexicalBlock(line: 9, column: 0, file: !1, scope: !0)
40 !12 = !MDCompositeType(tag: DW_TAG_structure_type, name: "X", line: 10, size: 64, align: 32, file: !27, scope: !0, elements: !13)
42 !14 = !MDDerivedType(tag: DW_TAG_member, name: "a", line: 10, size: 32, align: 32, file: !27, scope: !12, baseType: !5)
43 !15 = !MDDerivedType(tag: DW_TAG_member, name: "b", line: 10, size: 32, align: 32, offset: 32, file: !27, scope: !12, baseType: !5)
44 !16 = !MDGlobalVariable(name: "i", line: 5, isLocal: false, isDefinition: true, scope: !1, file: !1, type: !5, variable: i32* @i)
45 !17 = !MDLocation(line: 15, scope: !18)
46 !18 = distinct !MDLexicalBlock(line: 14, column: 0, file: !1, scope: !6)
47 !19 = !MDLocation(line: 9, scope: !0, inlinedAt: !17)
49 !21 = !MDLocation(line: 9, scope: !11, inlinedAt: !17)
50 !22 = !MDLocation(line: 11, scope: !11, inlinedAt: !17)
51 !23 = !MDLocation(line: 16, scope: !18)
55 !27 = !MDFile(filename: "bar.c", directory: "/tmp/")
56 !28 = !{i32 1, !"Debug Info Version", i32 3}