16 lines · c
1// Test use-sample-profile attribute is present only when SampleFDO2// is enabled.3//4// RUN: %clang_cc1 -O2 \5// RUN: -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -emit-llvm -o - \6// RUN: 2>&1 | FileCheck %s7// RUN: %clang_cc1 -O2 %s -emit-llvm -o - \8// RUN: 2>&1 | FileCheck %s --check-prefix=NOATTR9 10// CHECK: define{{.*}} @func{{.*}} #[[ATTRID:[0-9]+]]11// CHECK: attributes #[[ATTRID]] = {{.*}} "use-sample-profile"12// NOATTR: define{{.*}} @func{{.*}} #[[ATTRID:[0-9]+]]13// NOATTR-NOT: attributes #[[ATTRID]] = {{.*}} "use-sample-profile"14 15int func(int a) { return a; }16