diff options
| author | Justin Bogner <mail@justinbogner.com> | 2015-02-11 02:53:03 +0000 |
|---|---|---|
| committer | Justin Bogner <mail@justinbogner.com> | 2015-02-11 02:53:03 +0000 |
| commit | 2368c82de045871c0aeaec5b192c80ce95aa82ae (patch) | |
| tree | 002b39490a299b76253b05e01e9efc03175d3460 /clang/test | |
| parent | d24e185784585b5a4e0711521f33a329b6ec663b (diff) | |
| download | bcm5719-llvm-2368c82de045871c0aeaec5b192c80ce95aa82ae.tar.gz bcm5719-llvm-2368c82de045871c0aeaec5b192c80ce95aa82ae.zip | |
InstrProf: Add a test for PR22531
This is a test for the llvm change in r228793. We need to make sure
that names referred to by coverage end up in the right section, or the
coverage tools won't work.
llvm-svn: 228794
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/CoverageMapping/unused_names.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/test/CoverageMapping/unused_names.c b/clang/test/CoverageMapping/unused_names.c index b1317209610..8a57957378d 100644 --- a/clang/test/CoverageMapping/unused_names.c +++ b/clang/test/CoverageMapping/unused_names.c @@ -1,10 +1,15 @@ -// RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -fprofile-instr-generate -fcoverage-mapping -emit-llvm -main-file-name unused_names.c -o - %s > %t +// RUN: FileCheck -input-file %t %s +// RUN: FileCheck -check-prefix=SYSHEADER -input-file %t %s // Since foo is never emitted, there should not be a profile name for it. -// CHECK-NOT: @__llvm_profile_name_foo = -// CHECK: @__llvm_profile_name_bar = -// CHECK-NOT: @__llvm_profile_name_foo = +// CHECK-DAG: @__llvm_profile_name_bar = {{.*}} section "{{.*}}__llvm_prf_names" +// CHECK-DAG: @__llvm_profile_name_baz = {{.*}} section "{{.*}}__llvm_prf_names" +// CHECK-DAG: @"__llvm_profile_name_unused_names.c:qux" = {{.*}} section "{{.*}}__llvm_prf_names" + +// SYSHEADER-NOT: @__llvm_profile_name_foo = + #ifdef IS_SYSHEADER @@ -17,5 +22,7 @@ inline int foo() { return 0; } #include __FILE__ int bar() { return 0; } +inline int baz() { return 0; } +static int qux() { return 42; } #endif |

