summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/profile/Posix/instrprof-visibility.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-02-07 17:52:05 +0000
committerReid Kleckner <rnk@google.com>2019-02-07 17:52:05 +0000
commit17e2521724d49ea3fea6ff774499de1e942db782 (patch)
treede1b7c569f8d0199c7300f0fc6bdaf17a9a15291 /compiler-rt/test/profile/Posix/instrprof-visibility.cpp
parentc36c10ddfb3dc07129b9f3973029d17940f6a45f (diff)
downloadbcm5719-llvm-17e2521724d49ea3fea6ff774499de1e942db782.tar.gz
bcm5719-llvm-17e2521724d49ea3fea6ff774499de1e942db782.zip
[InstrProf] Port test suite to Windows
Summary: Before this change, check-profile would run, but all tests would be marked unsupported on Windows. This is the new status of 'check-profile' after this change: Testing Time: 6.66s Expected Passes : 29 Expected Failures : 5 Unsupported Tests : 39 I moved many tests that exercise posix-y features like dlopen and DSOs into the Posix subdirectory, and ran the tests on Linux to validate my changes. These are the remaining tests that I handled on a case by case basis: - instrprof-path.c Passes, Fixed some path portability issues - instrprof-gcov-exceptions.test Passes, the FileCheck actually succeeds on Windows, so I RUNX'd it - instrprof-icall-promo.test XFAILed, probably due to C++ ABI differences in vtables - instrprof-merge-match.test - instrprof-merge.c - instrprof-merging.cpp XFAILed, These seem like real bugs that need fixing - instrprof-version-mismatch.c XFAILed, Overriding the weak version symbol doesn't work - instrprof-without-libc.c UNSUPPORTED, test needs an executable symbol table, Windows has none Reviewers: davidxl, wmi, void Subscribers: fedor.sergeev, #sanitizers, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D57853 llvm-svn: 353435
Diffstat (limited to 'compiler-rt/test/profile/Posix/instrprof-visibility.cpp')
-rw-r--r--compiler-rt/test/profile/Posix/instrprof-visibility.cpp89
1 files changed, 89 insertions, 0 deletions
diff --git a/compiler-rt/test/profile/Posix/instrprof-visibility.cpp b/compiler-rt/test/profile/Posix/instrprof-visibility.cpp
new file mode 100644
index 00000000000..bb533050e05
--- /dev/null
+++ b/compiler-rt/test/profile/Posix/instrprof-visibility.cpp
@@ -0,0 +1,89 @@
+// RUN: %clangxx_profgen -fcoverage-mapping %S/Inputs/instrprof-visibility-helper.cpp -o %t %s
+// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t
+// RUN: llvm-profdata merge %t.profraw -o %t.profdata
+// RUN: llvm-profdata show --all-functions %t.profraw | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=PROFILE
+// RUN: llvm-cov show %t -instr-profile=%t.profdata | FileCheck -allow-deprecated-dag-overlap %s --check-prefix=COV
+
+namespace {
+#define NO_WEAK
+#define NO_EXTERN
+#include "instrprof-visibility-kinds.inc"
+#undef NO_EXTERN
+#undef NO_WEAK
+}
+
+namespace N1 {
+#include "instrprof-visibility-kinds.inc"
+}
+
+int main() {
+ call();
+ N1::call();
+ return 0;
+}
+
+// PROFILE-DAG: _ZN2N12f1Ev
+// PROFILE-DAG: _ZN2N12f2Ev
+// PROFILE-DAG: _ZN2N12f3Ev
+// PROFILE-DAG: _ZN2N12f4Ev
+// PROFILE-DAG: _ZN2N12f5Ev
+// PROFILE-DAG: _ZN2N12f6Ev
+// PROFILE-DAG: _ZN2N12f7Ev
+// PROFILE-DAG: _ZN2N14callEv
+// PROFILE-DAG: main
+// PROFILE-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_14callEv
+// PROFILE-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f1Ev
+// PROFILE-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f3Ev
+// PROFILE-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f5Ev
+// PROFILE-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f6Ev
+// PROFILE-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f7Ev
+// PROFILE-DAG: Total functions: 15
+
+// COV-DAG: instrprof-visibility-helper.cpp
+
+// COV-DAG: instrprof-visibility-kinds.inc
+
+// COV-DAG: _ZN2N12f1Ev
+// COV-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f1Ev
+// COV-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f3Ev
+// COV-DAG: _ZN2N12f3Ev
+// COV-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f5Ev
+// COV-DAG: _ZN2N12f5Ev
+// COV-DAG: _ZN2N12f6Ev
+// COV-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f6Ev
+// COV-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_12f7Ev
+// COV-DAG: _ZN2N12f7Ev
+
+// --- Check coverage for functions in the anonymous namespace.
+// COV-DAG: instrprof-visibility.cpp:_ZN12_GLOBAL__N_14callEv
+// COV-DAG: [[CALL:[0-9]+]]|{{ *}}1|void call() {
+// COV-DAG: {{.*}}|{{ *}}1| f1();
+// COV-DAG: {{.*}}|{{ *}}1|#ifndef NO_WEAK
+// COV-DAG: {{.*}}|{{ *}} | f2();
+// COV-DAG: {{.*}}|{{ *}} |#endif
+// COV-DAG: {{.*}}|{{ *}}1| f3();
+// COV-DAG: {{.*}}|{{ *}}1|#ifndef NO_EXTERN
+// COV-DAG: {{.*}}|{{ *}} | f4();
+// COV-DAG: {{.*}}|{{ *}} |#endif
+// COV-DAG: {{.*}}|{{ *}}1| f5();
+// COV-DAG: {{.*}}|{{ *}}1| f6();
+// COV-DAG: {{.*}}|{{ *}}1| f7();
+// COV-DAG: {{.*}}|{{ *}}1|}
+
+// --- Check coverage for functions in namespace N1.
+// COV-DAG: _ZN2N14callEv
+// COV-DAG: {{ *}}[[CALL]]|{{ *}}1|void call() {
+// COV-DAG: {{.*}}|{{ *}}1| f1();
+// COV-DAG: {{.*}}|{{ *}}1|#ifndef NO_WEAK
+// COV-DAG: {{.*}}|{{ *}}1| f2();
+// COV-DAG: {{.*}}|{{ *}}1|#endif
+// COV-DAG: {{.*}}|{{ *}}1| f3();
+// COV-DAG: {{.*}}|{{ *}}1|#ifndef NO_EXTERN
+// COV-DAG: {{.*}}|{{ *}}1| f4();
+// COV-DAG: {{.*}}|{{ *}}1|#endif
+// COV-DAG: {{.*}}|{{ *}}1| f5();
+// COV-DAG: {{.*}}|{{ *}}1| f6();
+// COV-DAG: {{.*}}|{{ *}}1| f7();
+// COV-DAG: {{.*}}|{{ *}}1|}
+
+// COV-DAG: instrprof-visibility.cpp
OpenPOWER on IntegriCloud