1; RUN: %llc_dwarf -O2 %s -o - | FileCheck %s 2; Check struct X for dead variable xyz from inlined function foo. 3 4; CHECK: DW_TAG_structure_type 5; CHECK-NEXT: info_string 6 7 8@i = common global i32 0 ; <i32*> [#uses=2] 9 10declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone 11 12declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone 13 14define i32 @bar() nounwind ssp { 15entry: 16 %0 = load i32* @i, align 4, !dbg !17 ; <i32> [#uses=2] 17 tail call void @llvm.dbg.value(metadata i32 %0, i64 0, metadata !9, metadata !{!"0x102"}), !dbg !19 18 tail call void @llvm.dbg.declare(metadata !29, metadata !10, metadata !{!"0x102"}), !dbg !21 19 %1 = mul nsw i32 %0, %0, !dbg !22 ; <i32> [#uses=2] 20 store i32 %1, i32* @i, align 4, !dbg !17 21 ret i32 %1, !dbg !23 22} 23 24!llvm.dbg.cu = !{!2} 25!llvm.module.flags = !{!28} 26 27!0 = !{!"0x2e\00foo\00foo\00\009\001\001\000\006\000\001\009", !27, !1, !3, null, null, null, null, !24} ; [ DW_TAG_subprogram ] 28!1 = !{!"0x29", !27} ; [ DW_TAG_file_type ] 29!2 = !{!"0x11\001\004.2.1 (Based on Apple Inc. build 5658) (LLVM build)\001\00\000\00\000", !27, !20, !20, !25, !26, !20} ; [ DW_TAG_compile_unit ] 30!3 = !{!"0x15\00\000\000\000\000\000\000", !27, !1, null, !4, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] 31!4 = !{!5, !5} 32!5 = !{!"0x24\00int\000\0032\0032\000\000\005", !27, !1} ; [ DW_TAG_base_type ] 33!6 = !{!"0x2e\00bar\00bar\00bar\0014\000\001\000\006\000\001\000", !27, !1, !7, null, i32 ()* @bar, null, null, null} ; [ DW_TAG_subprogram ] 34!7 = !{!"0x15\00\000\000\000\000\000\000", !27, !1, null, !8, null, null, null} ; [ DW_TAG_subroutine_type ] [line 0, size 0, align 0, offset 0] [from ] 35!8 = !{!5} 36!9 = !{!"0x101\00j\009\000", !0, !1, !5} ; [ DW_TAG_arg_variable ] 37!10 = !{!"0x100\00xyz\0010\000", !11, !1, !12} ; [ DW_TAG_auto_variable ] 38!11 = !{!"0xb\009\000\000", !1, !0} ; [ DW_TAG_lexical_block ] 39!12 = !{!"0x13\00X\0010\0064\0032\000\000\000", !27, !0, null, !13, null, null, null} ; [ DW_TAG_structure_type ] [X] [line 10, size 64, align 32, offset 0] [def] [from ] 40!13 = !{!14, !15} 41!14 = !{!"0xd\00a\0010\0032\0032\000\000", !27, !12, !5} ; [ DW_TAG_member ] 42!15 = !{!"0xd\00b\0010\0032\0032\0032\000", !27, !12, !5} ; [ DW_TAG_member ] 43!16 = !{!"0x34\00i\00i\00\005\000\001", !1, !1, !5, i32* @i, null} ; [ DW_TAG_variable ] 44!17 = !MDLocation(line: 15, scope: !18) 45!18 = !{!"0xb\0014\000\001", !1, !6} ; [ DW_TAG_lexical_block ] 46!19 = !MDLocation(line: 9, scope: !0, inlinedAt: !17) 47!20 = !{} 48!21 = !MDLocation(line: 9, scope: !11, inlinedAt: !17) 49!22 = !MDLocation(line: 11, scope: !11, inlinedAt: !17) 50!23 = !MDLocation(line: 16, scope: !18) 51!24 = !{!9, !10} 52!25 = !{!0, !6} 53!26 = !{!16} 54!27 = !{!"bar.c", !"/tmp/"} 55!28 = !{i32 1, !"Debug Info Version", i32 2} 56!29 = !{null} 57