Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/X86/split-dwarf-omit-empty.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 -split-dwarf-file=foo.dwo %t.ll -filetype=obj -o - | llvm-dwarfdump -debug-info - | FileCheck %s
6
7 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"
8 target triple = "spir64-unknown-unknown"
9
10 ; Created from:
11 ; a.cpp:
12 ; void f1();
13 ; inline __attribute__((always_inline)) __attribute__((used)) void f2() { f1(); }
14 ; b.cpp:
15 ; void f2();
16 ; void f3() {
17 ; f2();
18 ; }
19 ; $ clang++ -fno-split-dwarf-inlining {a,b}.cpp -emit-llvm -S -g
20 ; $ llvm-link {a,b}.ll -S -o ab.ll
21 ; Then strip out the @llvm.used global, so no out of line definition of 'f2'
22 ; will be emitted. This emulates something more like the available_externally
23 ; import performed by ThinLTO.
24
25 ; CHECK: .debug_info contents:
26 ; CHECK: Compile Unit
27 ; CHECK: Compile Unit
28 ; CHECK: .debug_info.dwo contents:
29
30
31 declare void @_Z2f1v()
32
33 ; Function Attrs: noinline norecurse uwtable
34 define i32 @main() !dbg !9 {
35 entry:
36 call void @_Z2f1v(), !dbg !13
37 ret i32 0, !dbg !18
38 }
39
40 !llvm.dbg.cu = !{!0, !3}
41 !llvm.ident = !{!5, !5}
42 !llvm.module.flags = !{!6, !7, !8}
43
44 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 304054) (llvm/trunk 304080)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false)
45 !1 = !DIFile(filename: "a.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
46 !2 = !{}
47 !3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !4, producer: "clang version 5.0.0 (trunk 304054) (llvm/trunk 304080)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false)
48 !4 = !DIFile(filename: "b.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
49 !5 = !{!"clang version 5.0.0 (trunk 304054) (llvm/trunk 304080)"}
50 !6 = !{i32 2, !"Dwarf Version", i32 4}
51 !7 = !{i32 2, !"Debug Info Version", i32 3}
52 !8 = !{i32 1, !"wchar_size", i32 4}
53 !9 = distinct !DISubprogram(name: "main", scope: !4, file: !4, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !3, retainedNodes: !2)
54 !10 = !DISubroutineType(types: !11)
55 !11 = !{!12}
56 !12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
57 !13 = !DILocation(line: 2, column: 73, scope: !14, inlinedAt: !17)
58 !14 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", scope: !1, file: !1, line: 2, type: !15, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
59 !15 = !DISubroutineType(types: !16)
60 !16 = !{null}
61 !17 = distinct !DILocation(line: 3, column: 3, scope: !9)
62 !18 = !DILocation(line: 4, column: 1, scope: !9)