1 // RUN: %clang_pgogen -fprofile-function-groups=3 -fprofile-selected-function-group=0 %s -o %t.0.out
2 // RUN: %clang_pgogen -fprofile-function-groups=3 -fprofile-selected-function-group=1 %s -o %t.1.out
3 // RUN: %clang_pgogen -fprofile-function-groups=3 -fprofile-selected-function-group=2 %s -o %t.2.out
4 // RUN: env LLVM_PROFILE_FILE=%t.0.profraw %run %t.0.out
5 // RUN: env LLVM_PROFILE_FILE=%t.1.profraw %run %t.1.out
6 // RUN: env LLVM_PROFILE_FILE=%t.2.profraw %run %t.2.out
7 // RUN: llvm-profdata merge -o %t.profdata %t.*.profraw
8 // RUN: llvm-profdata show %t.profdata --all-functions | FileCheck %s
10 int foo(int i
) { return 4 * i
+ 1; }
11 int bar(int i
) { return 4 * i
+ 2; }
12 int goo(int i
) { return 4 * i
+ 3; }
14 int main(int argc
, char *argv
[]) {
21 // Even though we ran this code three times, we expect all counts to be one if
22 // functions were partitioned into groups correctly.
28 // CHECK: Total functions: 4