Files
clang-p2996/clang/test/CodeGen/no_profile.c
Fangrui Song 71a35f7e3d [gcov] Simplify cc1 options and remove CodeGenOptions EmitCovNotes/EmitCovArcs
After a07b135ce0, we always pass
-coverage-notes-file/-coverage-data-file for driver options
-ftest-coverage/-fprofile-arcs/--coverage. As a bonus, we can make the following
simplification to cc1 options:

* `-ftest-coverage -coverage-notes-file a.gcno` => `-coverage-notes-file a.gcno`
* `-fprofile-arcs -coverage-data-file a.gcda` => `-coverage-data-file a.gcda`

and remove EmitCovNotes/EmitCovArcs.
2023-05-17 16:09:12 -07:00

22 lines
794 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 -coverage-data-file /dev/null -disable-llvm-passes \
// RUN: -emit-llvm -o - %s | FileCheck %s
int g(int);
void __attribute__((no_profile_instrument_function)) no_instr(void) {
// 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: }