xref: /llvm-project/clang/test/CodeGen/pgo-cold-function-coverage.c (revision bef3b54ea10a564a2de72f658f2efd64f537c079)
1 // Test -fprofile-generate-cold-function-coverage
2 
3 // RUN: rm -rf %t && split-file %s %t
4 // RUN: %clang --target=x86_64 -O2 -fprofile-generate-cold-function-coverage=/xxx/yyy/ -fprofile-sample-accurate -fprofile-sample-use=%t/pgo-cold-func.prof  -S -emit-llvm -o - %t/pgo-cold-func.c | FileCheck %s
5 
6 // CHECK: @__llvm_profile_filename = {{.*}} c"/xxx/yyy/default_%m.profraw\00"
7 
8 // CHECK: store i8 0, ptr @__profc_bar, align 1
9 // CHECK-NOT: @__profc_foo
10 
11 //--- pgo-cold-func.prof
12 foo:1:1
13  1: 1
14 
15 //--- pgo-cold-func.c
16 int bar(int x) { return x;}
17 int foo(int x) {
18     return x;
19 }
20