xref: /llvm-project/llvm/test/Transforms/SampleProfile/pseudo-probe-no-debug-info.ll (revision 23da2106246edd445b5eae105cbefe0493f4fd1d)
1; RUN: opt < %s -passes='pseudo-probe,cgscc(inline)' -S | FileCheck %s
2
3
4; CHECK-LABEL: @caller(
5
6; This instruction did not have a !dbg metadata in the callee but get a !dbg after inlined.
7; CHECK: store i32 1, {{.*}}, !dbg ![[#]]
8
9; This pseudo probe came from callee without a !dbg metadata.
10; CHECK-NOT:  call void @llvm.pseudoprobe({{.*}}), !dbg ![[#]]
11; CHECK:  call void @llvm.pseudoprobe({{.*}})
12
13
14target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
15target triple = "x86_64-unknown-linux-gnu"
16
17@a = common global i32 0, align 4
18@b = common global i32 0, align 4
19
20; Function Attrs: nounwind uwtable
21define void @callee() #0 {
22entry:
23  store i32 1, ptr @a, align 4
24  ret void
25}
26
27; Function Attrs: nounwind uwtable
28define void @caller() #0 !dbg !4 {
29entry:
30  tail call void @callee(), !dbg !12
31  ret void, !dbg !12
32}
33
34attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
35
36!llvm.dbg.cu = !{!0}
37!llvm.module.flags = !{!8, !9}
38!llvm.ident = !{!10}
39
40!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.5.0 (210174)", isOptimized: true, emissionKind: LineTablesOnly, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
41!1 = !DIFile(filename: "test.c", directory: "/code/llvm/build0")
42!2 = !{}
43!4 = distinct !DISubprogram(name: "caller", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, scopeLine: 4, file: !1, scope: !5, type: !6, retainedNodes: !2)
44!5 = !DIFile(filename: "test.c", directory: "/code/llvm/build0")
45!6 = !DISubroutineType(types: !2)
46!7 = distinct !DISubprogram(name: "callee2", line: 2, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, unit: !0, scopeLine: 2, file: !1, scope: !5, type: !6, retainedNodes: !2)
47!8 = !{i32 2, !"Dwarf Version", i32 4}
48!9 = !{i32 2, !"Debug Info Version", i32 3}
49!10 = !{!"clang version 3.5.0 (210174)"}
50!11 = !DILocation(line: 2, scope: !7)
51!12 = !DILocation(line: 4, scope: !4)
52