Debian Codegraph @

llvm-project/llvm/projects/llvm-spirv/test/DebugInfo/Generic/discriminator.ll

raw
1 ; REQUIRES: object-emission
2
3 ; RUN: llvm-as < %s -o %t.bc
4 ; RUN: llvm-spirv %t.bc -o %t.spv
5 ; RUN: llvm-spirv -r -emit-opaque-pointers %t.spv -o - | llvm-dis -o %t.ll
6
7 ; RUN: llc -mtriple=%triple < %t.ll -filetype=obj | llvm-dwarfdump -debug-info - | FileCheck %s
8
9 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"
10 target triple = "spir64-unknown-unknown"
11
12 ; Given the following source, ensure that the discriminator is emitted for
13 ; the inlined callsite.
14
15 ;void xyz();
16 ;static void __attribute__((always_inline)) bar() { xyz(); }
17 ;void foo() {
18 ; bar(); bar();
19 ;}
20
21 ;CHECK: DW_TAG_inlined_subroutine
22 ;CHECK-NOT: DW_AT_GNU_discriminator
23 ;CHECK: DW_TAG_inlined_subroutine
24 ;CHECK-NOT: {{DW_TAG|NULL}}
25 ;CHECK: DW_AT_GNU_discriminator{{.*}}0x01
26
27 ; Function Attrs: uwtable
28 define void @_Z3foov() #0 !dbg !4 {
29 tail call void @_Z3xyzv(), !dbg !11
30 tail call void @_Z3xyzv(), !dbg !13
31 ret void, !dbg !16
32 }
33
34 declare void @_Z3xyzv() #1
35
36 attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
37 attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
38
39 !llvm.dbg.cu = !{!0}
40 !llvm.module.flags = !{!8, !9}
41 !llvm.ident = !{!10}
42
43 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 252497)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
44 !1 = !DIFile(filename: "a.cc", directory: "/tmp")
45 !2 = !{}
46 !4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 3, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2)
47 !5 = !DISubroutineType(types: !6)
48 !6 = !{null}
49 !7 = distinct !DISubprogram(name: "bar", linkageName: "_ZL3barv", scope: !1, file: !1, line: 2, type: !5, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !2)
50 !8 = !{i32 2, !"Dwarf Version", i32 4}
51 !9 = !{i32 2, !"Debug Info Version", i32 3}
52 !10 = !{!"clang version 3.8.0 (trunk 252497)"}
53 !11 = !DILocation(line: 2, column: 52, scope: !7, inlinedAt: !12)
54 !12 = distinct !DILocation(line: 4, column: 3, scope: !4)
55 !13 = !DILocation(line: 2, column: 52, scope: !7, inlinedAt: !14)
56 !14 = distinct !DILocation(line: 4, column: 10, scope: !15)
57 !15 = !DILexicalBlockFile(scope: !4, file: !1, discriminator: 1)
58 !16 = !DILocation(line: 5, column: 1, scope: !4)