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