2015-05-28 05:58:42 +08:00
|
|
|
// Test that function entry counts are set correctly.
|
|
|
|
|
|
|
|
// RUN: llvm-profdata merge %S/Inputs/func-entry.proftext -o %t.profdata
|
2016-12-23 08:23:01 +08:00
|
|
|
// RUN: %clang_cc1 %s -o - -disable-llvm-passes -emit-llvm -fprofile-instrument-use-path=%t.profdata | FileCheck %s
|
2015-05-28 05:58:42 +08:00
|
|
|
|
|
|
|
void foo(void);
|
|
|
|
|
2016-01-05 07:32:28 +08:00
|
|
|
// CHECK: @foo() #{{[0-9]}} !prof [[FOO:![0-9]+]]
|
2015-05-28 05:58:42 +08:00
|
|
|
void foo() { return; }
|
|
|
|
|
2016-01-05 07:32:28 +08:00
|
|
|
// CHECK: @main() #{{[0-9]}} !prof [[MAIN:![0-9]+]]
|
2015-05-28 05:58:42 +08:00
|
|
|
int main() {
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < 10000; i++) foo();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CHECK: [[FOO]] = !{!"function_entry_count", i64 1000}
|
|
|
|
// CHECK: [[MAIN]] = !{!"function_entry_count", i64 1}
|