xref: /llvm-project/llvm/test/Transforms/SampleProfile/indirect-call-gcc.ll (revision 0271ae65a66367d802fa6866599d11e35f68450f)
15250e7a0SFangrui Song; RUN: opt -S %s -passes=sample-profile -sample-profile-file=%S/Inputs/indirect-call.afdo | FileCheck %s
2cee313d2SEric Christopher
3cee313d2SEric Christopher; Checks if indirect call targets are read correctly when reading from gcc
4cee313d2SEric Christopher; format profile.
5cee313d2SEric Christopher; It is expected to fail on certain architectures as gcc profile reader does
6cee313d2SEric Christopher; not work.
7cee313d2SEric Christopher
8*0271ae65SFangrui Songdefine void @test(ptr) #0 !dbg !3 {
9*0271ae65SFangrui Song  %2 = alloca ptr
10*0271ae65SFangrui Song  store ptr %0, ptr %2
11*0271ae65SFangrui Song  %3 = load ptr, ptr %2
12cee313d2SEric Christopher  ; CHECK: call {{.*}}, !prof ![[PROF:[0-9]+]]
13cee313d2SEric Christopher  call void %3(), !dbg !4
14cee313d2SEric Christopher  ret void
15cee313d2SEric Christopher}
16cee313d2SEric Christopher
177a6c8942SWei Miattributes #0 = {"use-sample-profile"}
187a6c8942SWei Mi
19cee313d2SEric Christopher!llvm.dbg.cu = !{!0}
20cee313d2SEric Christopher!llvm.module.flags = !{!2}
21cee313d2SEric Christopher
22cee313d2SEric Christopher!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1)
23cee313d2SEric Christopher!1 = !DIFile(filename: "test.cc", directory: "/")
24cee313d2SEric Christopher!2 = !{i32 2, !"Debug Info Version", i32 3}
25cee313d2SEric Christopher!3 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 1, unit: !0)
26cee313d2SEric Christopher!4 = !DILocation(line: 5, scope: !3)
27cee313d2SEric Christopher; CHECK: ![[PROF]] = !{!"VP", i32 0, i64 3457, i64 9191153033785521275, i64 2059, i64 -1069303473483922844, i64 1398}
28