diff options
author | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-05-27 18:47:56 +0000 |
commit | 3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65 (patch) | |
tree | dbbd4047878da71c1a706e26ce05b4e7791b14cc /test/Profile/c-general.c | |
parent | 38d6f2e7f2ce51a5b3836d26596c6c34a3288752 (diff) | |
download | FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.zip FreeBSD-src-3191b2b32a96e1a6ee833fcca73e5c8e0c67ba65.tar.gz |
Vendor import of clang trunk r238337:
https://llvm.org/svn/llvm-project/cfe/trunk@238337
Diffstat (limited to 'test/Profile/c-general.c')
-rw-r--r-- | test/Profile/c-general.c | 37 |
1 files changed, 26 insertions, 11 deletions
diff --git a/test/Profile/c-general.c b/test/Profile/c-general.c index 981fd98..4e123ae 100644 --- a/test/Profile/c-general.c +++ b/test/Profile/c-general.c @@ -8,17 +8,18 @@ // Also check compatibility with older profiles. // RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -main-file-name c-general.c %s -o - -emit-llvm -fprofile-instr-use=%S/Inputs/c-general.profdata.v1 | FileCheck -check-prefix=PGOUSE %s -// PGOGEN: @[[SLC:__llvm_profile_counters_simple_loops]] = hidden global [4 x i64] zeroinitializer -// PGOGEN: @[[IFC:__llvm_profile_counters_conditionals]] = hidden global [11 x i64] zeroinitializer -// PGOGEN: @[[EEC:__llvm_profile_counters_early_exits]] = hidden global [9 x i64] zeroinitializer -// PGOGEN: @[[JMC:__llvm_profile_counters_jumps]] = hidden global [22 x i64] zeroinitializer -// PGOGEN: @[[SWC:__llvm_profile_counters_switches]] = hidden global [19 x i64] zeroinitializer -// PGOGEN: @[[BSC:__llvm_profile_counters_big_switch]] = hidden global [17 x i64] zeroinitializer -// PGOGEN: @[[BOC:__llvm_profile_counters_boolean_operators]] = hidden global [8 x i64] zeroinitializer -// PGOGEN: @[[BLC:__llvm_profile_counters_boolop_loops]] = hidden global [9 x i64] zeroinitializer -// PGOGEN: @[[COC:__llvm_profile_counters_conditional_operator]] = hidden global [3 x i64] zeroinitializer -// PGOGEN: @[[MAC:__llvm_profile_counters_main]] = hidden global [1 x i64] zeroinitializer -// PGOGEN: @[[STC:"__llvm_profile_counters_c-general.c:static_func"]] = internal global [2 x i64] zeroinitializer +// PGOGEN: @[[SLC:__llvm_profile_counters_simple_loops]] = private global [4 x i64] zeroinitializer +// PGOGEN: @[[IFC:__llvm_profile_counters_conditionals]] = private global [11 x i64] zeroinitializer +// PGOGEN: @[[EEC:__llvm_profile_counters_early_exits]] = private global [9 x i64] zeroinitializer +// PGOGEN: @[[JMC:__llvm_profile_counters_jumps]] = private global [22 x i64] zeroinitializer +// PGOGEN: @[[SWC:__llvm_profile_counters_switches]] = private global [19 x i64] zeroinitializer +// PGOGEN: @[[BSC:__llvm_profile_counters_big_switch]] = private global [17 x i64] zeroinitializer +// PGOGEN: @[[BOC:__llvm_profile_counters_boolean_operators]] = private global [8 x i64] zeroinitializer +// PGOGEN: @[[BLC:__llvm_profile_counters_boolop_loops]] = private global [9 x i64] zeroinitializer +// PGOGEN: @[[COC:__llvm_profile_counters_conditional_operator]] = private global [3 x i64] zeroinitializer +// PGOGEN: @[[DFC:__llvm_profile_counters_do_fallthrough]] = private global [4 x i64] zeroinitializer +// PGOGEN: @[[MAC:__llvm_profile_counters_main]] = private global [1 x i64] zeroinitializer +// PGOGEN: @[[STC:"__llvm_profile_counters_c-general.c:static_func"]] = private global [2 x i64] zeroinitializer // PGOGEN-LABEL: @simple_loops() // PGOUSE-LABEL: @simple_loops() @@ -436,15 +437,24 @@ void conditional_operator() { // PGOUSE-NOT: br {{.*}} !prof ![0-9]+ } +// PGOGEN-LABEL: @do_fallthrough() +// PGOUSE-LABEL: @do_fallthrough() +// PGOGEN: store {{.*}} @[[DFC]], i64 0, i64 0 void do_fallthrough() { + // PGOGEN: store {{.*}} @[[DFC]], i64 0, i64 1 + // PGOUSE: br {{.*}} !prof ![[DF1:[0-9]+]] for (int i = 0; i < 10; ++i) { int j = 0; + // PGOGEN: store {{.*}} @[[DFC]], i64 0, i64 2 do { // The number of exits out of this do-loop via the break statement // exceeds the counter value for the loop (which does not include the // fallthrough count). Make sure that does not violate any assertions. + // PGOGEN: store {{.*}} @[[DFC]], i64 0, i64 3 + // PGOUSE: br {{.*}} !prof ![[DF3:[0-9]+]] if (i < 8) break; j++; + // PGOUSE: br {{.*}} !prof ![[DF2:[0-9]+]] } while (j < 2); } } @@ -529,6 +539,11 @@ static void static_func() { // PGOUSE-DAG: ![[BL8]] = !{!"branch_weights", i32 51, i32 2} // PGOUSE-DAG: ![[CO1]] = !{!"branch_weights", i32 1, i32 2} // PGOUSE-DAG: ![[CO2]] = !{!"branch_weights", i32 2, i32 1} + +// PGOUSE-DAG: ![[DF1]] = !{!"branch_weights", i32 11, i32 2} +// PGOUSE-DAG: ![[DF2]] = !{!"branch_weights", i32 3, i32 3} +// PGOUSE-DAG: ![[DF3]] = !{!"branch_weights", i32 9, i32 5} + // PGOUSE-DAG: ![[ST1]] = !{!"branch_weights", i32 11, i32 2} int main(int argc, const char *argv[]) { |