Files
clang-p2996/clang/test/CodeGen/no_profile.c
Nick Desaulniers a63d4f6cba [Clang][Codegen] rename no_profile fn attr no_profile_instrument_function
GCC has had this function attribute since GCC 7.1 for this purpose. I
added "no_profile" last week in D104475; rename this to
"no_profile_instrument_function" to improve compatibility with GCC.

Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80223#c11

Reviewed By: MaskRay, aaron.ballman

Differential Revision: https://reviews.llvm.org/D104658
2021-06-21 11:42:06 -07:00

22 lines
775 B
C

// RUN: %clang_cc1 -fprofile-instrument=llvm -disable-llvm-passes \
// RUN: -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fprofile-instrument=csllvm -disable-llvm-passes \
// RUN: -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fprofile-instrument=clang -disable-llvm-passes \
// RUN: -emit-llvm -o - %s | FileCheck %s
// RUN: %clang_cc1 -fprofile-arcs -disable-llvm-passes \
// RUN: -emit-llvm -o - %s | FileCheck %s
int g(int);
void __attribute__((no_profile_instrument_function)) no_instr() {
// CHECK: define {{.*}}void @no_instr() [[ATTR:#[0-9]+]]
}
void instr(void) {
// CHECK: define {{.*}}void @instr() [[ATTR2:#[0-9]+]]
}
// CHECK: attributes [[ATTR]] = {{.*}} noprofile
// CHECK: attributes [[ATTR2]] = {
// CHECK-NOT: noprofile
// CHECK: }