1 // Test that clang doesn't emit llvm.expect when the counter is 0
3 // RUN: llvm-profdata merge %S/Inputs/cxx-never-executed-branch.proftext -o %t.profdata
4 // RUN: %clang_cc1 -std=c++20 %s -triple %itanium_abi_triple -O2 -o - -emit-llvm -fprofile-instrument-use-path=%t.profdata -disable-llvm-passes | FileCheck %s
8 // CHECK: define {{.*}}@_Z13is_in_profilev
9 // CHECK-NOT: call {{.*}}@llvm.expect
14 if (rando
== 0) [[likely
]]
21 // CHECK: define {{.*}}@_Z17is_not_in_profilev
22 // CHECK: call {{.*}}@llvm.expect
24 int is_not_in_profile() {
27 if (rando
== 0) [[likely
]]