func-entry.c 554 B

12345678910111213141516171819
  1. // Test that function entry counts are set correctly.
  2. // RUN: llvm-profdata merge %S/Inputs/func-entry.proftext -o %t.profdata
  3. // RUN: %clang %s -o - -mllvm -disable-llvm-optzns -emit-llvm -S -fprofile-instr-use=%t.profdata | FileCheck %s
  4. void foo(void);
  5. // CHECK: @foo() #0 !prof [[FOO:![0-9]+]]
  6. void foo() { return; }
  7. // CHECK: @main() #1 !prof [[MAIN:![0-9]+]]
  8. int main() {
  9. int i;
  10. for (i = 0; i < 10000; i++) foo();
  11. return 0;
  12. }
  13. // CHECK: [[FOO]] = !{!"function_entry_count", i64 1000}
  14. // CHECK: [[MAIN]] = !{!"function_entry_count", i64 1}