diff options
author | Justin Bogner <mail@justinbogner.com> | 2015-07-28 00:41:51 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2015-07-28 00:41:51 +0000 |
commit | 203f09223bb0bed16194d6a28431ba6a2fd5346a (patch) | |
tree | 4a81e9bca5a80fe3ffdad2cd3249da897e523bcf /clang/test/CoverageMapping/decl.c | |
parent | 80414569b8c73bfc5c10a7fd93b2c37c96ddfdae (diff) | |
download | bcm5719-llvm-203f09223bb0bed16194d6a28431ba6a2fd5346a.tar.gz bcm5719-llvm-203f09223bb0bed16194d6a28431ba6a2fd5346a.zip |
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
Diffstat (limited to 'clang/test/CoverageMapping/decl.c')
-rw-r--r-- | clang/test/CoverageMapping/decl.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/test/CoverageMapping/decl.c b/clang/test/CoverageMapping/decl.c new file mode 100644 index 00000000000..96ee30357a8 --- /dev/null +++ b/clang/test/CoverageMapping/decl.c @@ -0,0 +1,15 @@ +// 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(); |