xref: /llvm-project/llvm/test/DebugInfo/Generic/inlined-vars.ll (revision 10b03e66629aedad79a804e22d23b575077303b3)
1; RUN: %llc_dwarf -O0 < %s | FileCheck %s -check-prefix ARGUMENT
2; RUN: %llc_dwarf -O0 < %s | FileCheck %s -check-prefix VARIABLE
3; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -O0 < %s | FileCheck %s -check-prefix ARGUMENT
4; RUN: %llc_dwarf --try-experimental-debuginfo-iterators -O0 < %s | FileCheck %s -check-prefix VARIABLE
5; PR 13202
6
7define i32 @main() uwtable !dbg !5 {
8entry:
9  tail call void @llvm.dbg.value(metadata i32 0, metadata !18, metadata !DIExpression()), !dbg !21
10  tail call void @llvm.dbg.value(metadata i32 0, metadata !22, metadata !DIExpression()), !dbg !23
11  tail call void @smth(i32 0), !dbg !24
12  tail call void @smth(i32 0), !dbg !25
13  ret i32 0, !dbg !19
14}
15
16declare void @smth(i32)
17
18declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone
19
20!llvm.dbg.cu = !{!0}
21!llvm.module.flags = !{!27}
22
23!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.2 (trunk 159419)", isOptimized: true, emissionKind: FullDebug, file: !26, enums: !2, retainedTypes: !2, globals: !2, imports:  !2)
24!1 = !{i32 0}
25!2 = !{}
26!5 = distinct !DISubprogram(name: "main", line: 10, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 10, file: !26, scope: !6, type: !7, retainedNodes: !2)
27!6 = !DIFile(filename: "inline-bug.cc", directory: "/tmp/dbginfo/pr13202")
28!7 = !DISubroutineType(types: !8)
29!8 = !{!9}
30!9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
31!10 = distinct !DISubprogram(name: "f", linkageName: "_ZL1fi", line: 3, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3, file: !26, scope: !6, type: !11, retainedNodes: !13)
32!11 = !DISubroutineType(types: !12)
33!12 = !{!9, !9}
34!13 = !{!15, !16}
35!15 = !DILocalVariable(name: "argument", line: 3, arg: 1, scope: !10, file: !6, type: !9)
36
37; Two DW_TAG_formal_parameter: one abstract and one inlined.
38; ARGUMENT: {{.*Abbrev.*DW_TAG_formal_parameter}}
39; ARGUMENT: {{.*Abbrev.*DW_TAG_formal_parameter}}
40; ARGUMENT-NOT: {{.*Abbrev.*DW_TAG_formal_parameter}}
41
42!16 = !DILocalVariable(name: "local", line: 4, scope: !10, file: !6, type: !9)
43
44; Two DW_TAG_variable: one abstract and one inlined.
45; VARIABLE: {{.*Abbrev.*DW_TAG_variable}}
46; VARIABLE: {{.*Abbrev.*DW_TAG_variable}}
47; VARIABLE-NOT: {{.*Abbrev.*DW_TAG_variable}}
48
49!18 = !DILocalVariable(name: "argument", line: 3, arg: 1, scope: !10, file: !6, type: !9)
50!19 = !DILocation(line: 11, column: 10, scope: !5)
51!21 = !DILocation(line: 3, column: 25, scope: !10, inlinedAt: !19)
52!22 = !DILocalVariable(name: "local", line: 4, scope: !10, file: !6, type: !9)
53!23 = !DILocation(line: 4, column: 16, scope: !10, inlinedAt: !19)
54!24 = !DILocation(line: 5, column: 3, scope: !10, inlinedAt: !19)
55!25 = !DILocation(line: 6, column: 3, scope: !10, inlinedAt: !19)
56!26 = !DIFile(filename: "inline-bug.cc", directory: "/tmp/dbginfo/pr13202")
57!27 = !{i32 1, !"Debug Info Version", i32 3}
58