// Test that function entry counts are set correctly.

// RUN: llvm-profdata merge %S/Inputs/func-entry.proftext -o %t.profdata
// RUN: %clang %s -o - -mllvm -disable-llvm-optzns -emit-llvm -S -fprofile-instr-use=%t.profdata | FileCheck %s

void foo(void);

// CHECK: define void @foo() #0 !prof [[FOO:![0-9]+]]
void foo() { return; }

// CHECK: define i32 @main() #1 !prof [[MAIN:![0-9]+]]
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}

// Test that function entry counts are set correctly.

// RUN: llvm-profdata merge %S/Inputs/func-entry.proftext -o %t.profdata
// RUN: %clang %s -o - -mllvm -disable-llvm-optzns -emit-llvm -S -fprofile-instr-use=%t.profdata | FileCheck %s

void foo(void);

// CHECK: @foo() #0 !prof [[FOO:![0-9]+]]
void foo() { return; }

// CHECK: @main() #1 !prof [[MAIN:![0-9]+]]
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}

Fix PPC failure. Adjust CHECK pattern.
Fix PPC failure. Adjust CHECK pattern.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@238413 91177308-0d34-0410-b5e6-96231b3b80d8
