r228794 - InstrProf: Add a test for PR22531
Justin Bogner
mail at justinbogner.com
Tue Feb 10 18:53:03 PST 2015
Author: bogner
Date: Tue Feb 10 20:53:03 2015
New Revision: 228794
URL: http://llvm.org/viewvc/llvm-project?rev=228794&view=rev
Log:
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.
Modified:
cfe/trunk/test/CoverageMapping/unused_names.c
Modified: cfe/trunk/test/CoverageMapping/unused_names.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CoverageMapping/unused_names.c?rev=228794&r1=228793&r2=228794&view=diff
==============================================================================
--- cfe/trunk/test/CoverageMapping/unused_names.c (original)
+++ cfe/trunk/test/CoverageMapping/unused_names.c Tue Feb 10 20:53:03 2015
@@ -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
More information about the cfe-commits
mailing list