Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/Generic/inlined-vars.ll

raw
1 ; RUN: llvm-as < %s -o %t.bc
2 ; RUN: llvm-spirv %t.bc -o %t.spv
3 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.ll
4
5 ; RUN: llc -mtriple=%triple -O0 < %t.ll | FileCheck %s -check-prefix ARGUMENT
6 ; RUN: llc -mtriple=%triple -O0 < %t.ll | FileCheck %s -check-prefix VARIABLE
7
8 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
9 target triple = "spir64-unknown-unknown"
10 ; PR 13202
11
12 define i32 @main() uwtable !dbg !5 {
13 entry:
14 tail call void @llvm.dbg.value(metadata i32 0, metadata !18, metadata !DIExpression()), !dbg !21
15 tail call void @llvm.dbg.value(metadata i32 0, metadata !22, metadata !DIExpression()), !dbg !23
16 tail call void @smth(i32 0), !dbg !24
17 tail call void @smth(i32 0), !dbg !25
18 ret i32 0, !dbg !19
19 }
20
21 declare void @smth(i32)
22
23 declare void @llvm.dbg.value(metadata, metadata, metadata) nounwind readnone
24
25 !llvm.dbg.cu = !{!0}
26 !llvm.module.flags = !{!27}
27
28 !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)
29 !1 = !{i32 0}
30 !2 = !{}
31 !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)
32 !6 = !DIFile(filename: "inline-bug.cc", directory: "/tmp/dbginfo/pr13202")
33 !7 = !DISubroutineType(types: !8)
34 !8 = !{!9}
35 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
36 !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)
37 !11 = !DISubroutineType(types: !12)
38 !12 = !{!9, !9}
39 !13 = !{!15, !16}
40 !15 = !DILocalVariable(name: "argument", line: 3, arg: 1, scope: !10, file: !6, type: !9)
41
42 ; Two DW_TAG_formal_parameter: one abstract and one inlined.
43 ; ARGUMENT: {{.*Abbrev.*DW_TAG_formal_parameter}}
44 ; ARGUMENT: {{.*Abbrev.*DW_TAG_formal_parameter}}
45 ; ARGUMENT-NOT: {{.*Abbrev.*DW_TAG_formal_parameter}}
46
47 !16 = !DILocalVariable(name: "local", line: 4, scope: !10, file: !6, type: !9)
48
49 ; Two DW_TAG_variable: one abstract and one inlined.
50 ; VARIABLE: {{.*Abbrev.*DW_TAG_variable}}
51 ; VARIABLE: {{.*Abbrev.*DW_TAG_variable}}
52 ; VARIABLE-NOT: {{.*Abbrev.*DW_TAG_variable}}
53
54 !18 = !DILocalVariable(name: "argument", line: 3, arg: 1, scope: !10, file: !6, type: !9)
55 !19 = !DILocation(line: 11, column: 10, scope: !5)
56 !21 = !DILocation(line: 3, column: 25, scope: !10, inlinedAt: !19)
57 !22 = !DILocalVariable(name: "local", line: 4, scope: !10, file: !6, type: !9)
58 !23 = !DILocation(line: 4, column: 16, scope: !10, inlinedAt: !19)
59 !24 = !DILocation(line: 5, column: 3, scope: !10, inlinedAt: !19)
60 !25 = !DILocation(line: 6, column: 3, scope: !10, inlinedAt: !19)
61 !26 = !DIFile(filename: "inline-bug.cc", directory: "/tmp/dbginfo/pr13202")
62 !27 = !{i32 1, !"Debug Info Version", i32 3}