| 1 |
; RUN: opt < %s -sample-profile-file=%S/Inputs/coro-annotate.prof -passes=sample-profile -S | FileCheck %s |
| 2 |
|
| 3 |
; This test checks if a coro function can correctly get sample annotation with the present of its await suspend wrappers. |
| 4 |
; Please ignore the incomplete coro function body and missing coro intrinsics since only the function names matter here. |
| 5 |
; Note: Do not change the function names. They are intentionally made to create a specific order in the module's ValSymTab iterator. |
| 6 |
|
| 7 |
; CHECK: define void @bar() {{.*}} !prof ![[PROF:[0-9]+]] |
| 8 |
; CHECK: ![[PROF]] = !{!"function_entry_count", i64 13294} |
| 9 |
define void @bar() #0 !dbg !4 { |
| 10 |
entry: |
| 11 |
ret void, !dbg !9 |
| 12 |
} |
| 13 |
|
| 14 |
define internal void @bar.__await_suspend_wrapper__init(ptr noundef nonnull %0, ptr noundef %1) #1 { |
| 15 |
entry: |
| 16 |
ret void |
| 17 |
} |
| 18 |
|
| 19 |
attributes #0 = { presplitcoroutine "use-sample-profile" } |
| 20 |
attributes #1 = { "sample-profile-suffix-elision-policy"="selected" } |
| 21 |
|
| 22 |
!llvm.module.flags = !{!7, !8} |
| 23 |
|
| 24 |
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1) |
| 25 |
!1 = !DIFile(filename: "test.c", directory: "") |
| 26 |
!2 = !{} |
| 27 |
!4 = distinct !DISubprogram(name: "bar", scope: !1, file: !1, line: 1, type: !5, isLocal: false, isDefinition: true, scopeLine: 1, isOptimized: false, unit: !0, retainedNodes: !2) |
| 28 |
!5 = !DISubroutineType(types: !2) |
| 29 |
!7 = !{i32 2, !"Dwarf Version", i32 4} |
| 30 |
!8 = !{i32 2, !"Debug Info Version", i32 3} |
| 31 |
!9 = !DILocation(line: 1, column: 15, scope: !4) |