diff options
Diffstat (limited to 'clang/test/CodeGen')
| -rw-r--r-- | clang/test/CodeGen/Inputs/instr-profile.pgodata | 4 | ||||
| -rw-r--r-- | clang/test/CodeGen/instr-profile.c | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeGen/Inputs/instr-profile.pgodata b/clang/test/CodeGen/Inputs/instr-profile.pgodata index 07e763ed1de..f6337d23329 100644 --- a/clang/test/CodeGen/Inputs/instr-profile.pgodata +++ b/clang/test/CodeGen/Inputs/instr-profile.pgodata @@ -132,3 +132,7 @@ no_usable_data 5 main 1 1 +instr-profile.c:static_func 2 +1 +10 + diff --git a/clang/test/CodeGen/instr-profile.c b/clang/test/CodeGen/instr-profile.c index c982dcb7582..f753f8306d4 100644 --- a/clang/test/CodeGen/instr-profile.c +++ b/clang/test/CodeGen/instr-profile.c @@ -18,6 +18,7 @@ // PGOGEN: @[[BLC:__llvm_pgo_ctr[0-9]*]] = private global [9 x i64] zeroinitializer // PGOGEN: @[[NOC:__llvm_pgo_ctr[0-9]*]] = private global [2 x i64] zeroinitializer // PGOGEN: @[[MAC:__llvm_pgo_ctr[0-9]*]] = private global [1 x i64] zeroinitializer +// PGOGEN: @[[STF:__llvm_pgo_ctr[0-9]*]] = private global [2 x i64] zeroinitializer // PGOGEN-LABEL: @simple_loops() // PGOUSE-LABEL: @simple_loops() @@ -445,6 +446,16 @@ void no_usable_data() { // PGOUSE-NOT: br {{.*}} !prof ![0-9]+ } +// PGOGEN-LABEL: @static_func() +// PGOUSE-LABEL: @static_func() +// PGOGEN: store {{.*}} @[[STF]], i64 0, i64 0 +static void static_func() { + // PGOGEN: store {{.*}} @[[STF]], i64 0, i64 1 + // PGOUSE: br {{.*}} !prof ![[ST1:[0-9]+]] + for (int i = 0; i < 10; ++i) { + } +} + // PGOUSE-DAG: ![[SL1]] = metadata !{metadata !"branch_weights", i32 101, i32 2} // PGOUSE-DAG: ![[SL2]] = metadata !{metadata !"branch_weights", i32 101, i32 2} // PGOUSE-DAG: ![[SL3]] = metadata !{metadata !"branch_weights", i32 76, i32 2} @@ -513,6 +524,7 @@ void no_usable_data() { // PGOUSE-DAG: ![[BL6]] = metadata !{metadata !"branch_weights", i32 51, i32 2} // PGOUSE-DAG: ![[BL7]] = metadata !{metadata !"branch_weights", i32 26, i32 27} // PGOUSE-DAG: ![[BL8]] = metadata !{metadata !"branch_weights", i32 51, i32 2} +// PGOUSE-DAG: ![[ST1]] = metadata !{metadata !"branch_weights", i32 11, i32 2} int main(int argc, const char *argv[]) { simple_loops(); @@ -525,5 +537,6 @@ int main(int argc, const char *argv[]) { boolop_loops(); do_fallthrough(); no_usable_data(); + static_func(); return 0; } |

