Files
clang-p2996/clang/test/CoverageMapping/decl.c
Justin Bogner 203f09223b InstrProf: Fix a misuse of the FunctionDecl API when generating coverage
This was calling FD->hasBody(), meaning "Does the function that this
decl refers to have a body?", rather than
FD->doesThisDeclarationHaveABody(), meaning "Is this decl a
non-deleted definition?".

We might want to consider renaming these APIs :/

llvm-svn: 243360
2015-07-28 00:41:51 +00:00

16 lines
437 B
C

// Ensure that declarations without definitions don't have maps emitted for them
// RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -dump-coverage-mapping -emit-llvm-only %s > %t
// FileCheck -input-file %t %s
// RUN: FileCheck -check-prefix BAR -input-file %t %s
// FOO: foo:
// FOO-NOT: foo:
inline int foo() { return 0; }
extern inline int foo();
// BAR: bar:
// BAR-NOT: bar:
int bar() { return 0; }
extern int bar();