From 17e2521724d49ea3fea6ff774499de1e942db782 Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Thu, 7 Feb 2019 17:52:05 +0000 Subject: [PATCH] [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 --- ...nstrprof-gcov-__gcov_flush-multiple.c.gcov | 2 +- ...strprof-gcov-__gcov_flush-terminate.c.gcov | 2 +- .../Inputs/instrprof-gcov-exceptions.cpp.gcov | 2 +- .../Inputs/instrprof-gcov-execlp.c.gcov | 2 +- .../Inputs/instrprof-gcov-execvp.c.gcov | 2 +- .../profile/Inputs/instrprof-gcov-fork.c.gcov | 2 +- ...rprof-gcov-multiple-bbs-single-line.c.gcov | 2 +- .../instrprof-gcov-one-line-function.c.gcov | 2 +- .../Inputs/instrprof-gcov-switch1.c.gcov | 2 +- .../Inputs/instrprof-gcov-switch2.c.gcov | 2 +- .../Inputs/instrprof-shared-lib.c.gcov | 2 +- .../instrprof-shared-lib_called-twice.c.gcov | 2 +- .../instrprof-shared-lib_in-loop.c.gcov | 2 +- ...-shared-main-gcov-flush_no-writeout.c.gcov | 2 +- ...d-main-gcov-flush_shared-call-after.c.gcov | 2 +- ...gcov-flush_shared-call-before-after.c.gcov | 2 +- ...-main-gcov-flush_shared-call-before.c.gcov | 2 +- .../Inputs/instrprof-shared-main.c.gcov | 2 +- .../Inputs/instrprof-visibility-helper.cpp | 0 .../instrprof-dlopen-dlclose-gcov.test | 24 +++++----- .../profile/{ => Posix}/instrprof-dlopen.test | 30 ++++++------ .../instrprof-dynamic-one-shared.test | 18 +++---- .../instrprof-dynamic-two-shared.test | 20 ++++---- .../instrprof-set-filename-shared.test | 4 +- .../instrprof-shared-gcov-flush.test | 26 +++++----- .../profile/{ => Posix}/instrprof-shared.test | 34 ++++++------- .../instrprof-value-prof-shared.test | 48 +++++++++---------- .../instrprof-visibility-kinds.inc | 0 .../{ => Posix}/instrprof-visibility.cpp | 0 compiler-rt/test/profile/Posix/lit.local.cfg | 9 ++++ .../profile/instrprof-gcov-exceptions.test | 4 +- .../test/profile/instrprof-icall-promo.test | 3 ++ .../test/profile/instrprof-merge-match.test | 2 + compiler-rt/test/profile/instrprof-merge.c | 3 ++ .../test/profile/instrprof-merging.cpp | 3 ++ compiler-rt/test/profile/instrprof-path.c | 26 ++++++---- .../test/profile/instrprof-version-mismatch.c | 3 ++ .../test/profile/instrprof-without-libc.c | 4 ++ compiler-rt/test/profile/lit.cfg | 2 +- 39 files changed, 167 insertions(+), 132 deletions(-) rename compiler-rt/test/profile/{ => Posix}/Inputs/instrprof-visibility-helper.cpp (100%) rename compiler-rt/test/profile/{ => Posix}/instrprof-dlopen-dlclose-gcov.test (54%) rename compiler-rt/test/profile/{ => Posix}/instrprof-dlopen.test (59%) rename compiler-rt/test/profile/{ => Posix}/instrprof-dynamic-one-shared.test (59%) rename compiler-rt/test/profile/{ => Posix}/instrprof-dynamic-two-shared.test (56%) rename compiler-rt/test/profile/{ => Posix}/instrprof-set-filename-shared.test (81%) rename compiler-rt/test/profile/{ => Posix}/instrprof-shared-gcov-flush.test (67%) rename compiler-rt/test/profile/{ => Posix}/instrprof-shared.test (80%) rename compiler-rt/test/profile/{ => Posix}/instrprof-value-prof-shared.test (64%) rename compiler-rt/test/profile/{ => Posix}/instrprof-visibility-kinds.inc (100%) rename compiler-rt/test/profile/{ => Posix}/instrprof-visibility.cpp (100%) create mode 100644 compiler-rt/test/profile/Posix/lit.local.cfg diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov index f2141229bd4f..83755451631d 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-multiple.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-gcov-__gcov_flush-multiple.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-__gcov_flush-multiple.c // CHECK-NEXT: -: 0:Graph:instrprof-gcov-__gcov_flush-multiple.gcno // CHECK-NEXT: -: 0:Data:instrprof-gcov-__gcov_flush-multiple.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c.gcov index 69e229a3127e..1e3a56bd9edb 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-__gcov_flush-terminate.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-gcov-__gcov_flush-terminate.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-__gcov_flush-terminate.c // CHECK-NEXT: -: 0:Graph:instrprof-gcov-__gcov_flush-terminate.gcno // CHECK-NEXT: -: 0:Data:instrprof-gcov-__gcov_flush-terminate.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-exceptions.cpp.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-exceptions.cpp.gcov index f8e38297475d..aa202763fd56 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-exceptions.cpp.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-exceptions.cpp.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-gcov-exceptions.cpp +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-exceptions.cpp // CHECK-NEXT: -: 0:Graph:instrprof-gcov-exceptions.gcno // CHECK-NEXT: -: 0:Data:instrprof-gcov-exceptions.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-execlp.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-execlp.c.gcov index 7542f6ff73b2..810046aac396 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-execlp.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-execlp.c.gcov @@ -1,4 +1,4 @@ -//CHECK: -: 0:Source:{{.*}}Inputs/instrprof-gcov-execlp.c +//CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-execlp.c //CHECK-NEXT: -: 0:Graph:instrprof-gcov-execlp.gcno //CHECK-NEXT: -: 0:Data:instrprof-gcov-execlp.gcda //CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-execvp.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-execvp.c.gcov index 37cd1e59ab38..e896cb8917e7 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-execvp.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-execvp.c.gcov @@ -1,4 +1,4 @@ -//CHECK: -: 0:Source:{{.*}}Inputs/instrprof-gcov-execvp.c +//CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-execvp.c //CHECK-NEXT: -: 0:Graph:instrprof-gcov-execvp.gcno //CHECK-NEXT: -: 0:Data:instrprof-gcov-execvp.gcda //CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-fork.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-fork.c.gcov index c667c7b9e97e..2825bd5802a7 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-fork.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-fork.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-gcov-fork.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-fork.c // CHECK-NEXT: -: 0:Graph:instrprof-gcov-fork.gcno // CHECK-NEXT: -: 0:Data:instrprof-gcov-fork.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov index 4bc1c1cd50f7..d1104b7f5bbf 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-multiple-bbs-single-line.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-gcov-multiple-bbs-single-line.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-multiple-bbs-single-line.c // CHECK-NEXT: -: 0:Graph:instrprof-gcov-multiple-bbs-single-line.gcno // CHECK-NEXT: -: 0:Data:instrprof-gcov-multiple-bbs-single-line.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-one-line-function.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-one-line-function.c.gcov index a91b20fdc9a3..5a570a04742d 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-one-line-function.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-one-line-function.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-gcov-one-line-function.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-one-line-function.c // CHECK-NEXT: -: 0:Graph:instrprof-gcov-one-line-function.gcno // CHECK-NEXT: -: 0:Data:instrprof-gcov-one-line-function.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-switch1.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-switch1.c.gcov index 6e9c5228b938..741dff59954b 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-switch1.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-switch1.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-gcov-switch1.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-switch1.c // CHECK-NEXT: -: 0:Graph:instrprof-gcov-switch1.gcno // CHECK-NEXT: -: 0:Data:instrprof-gcov-switch1.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-gcov-switch2.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-gcov-switch2.c.gcov index 47d7f1d7cb41..c931365ddf48 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-gcov-switch2.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-gcov-switch2.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-gcov-switch2.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-gcov-switch2.c // CHECK-NEXT: -: 0:Graph:instrprof-gcov-switch2.gcno // CHECK-NEXT: -: 0:Data:instrprof-gcov-switch2.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov index 620a85257577..7e6d741d5b10 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-lib.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-shared-lib.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-lib.c // CHECK-NEXT: -: 0:Graph:instrprof-shared-lib.gcno // CHECK-NEXT: -: 0:Data:instrprof-shared-lib.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-lib_called-twice.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-lib_called-twice.c.gcov index 39b32b8c097a..993c6cc508b2 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-lib_called-twice.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-lib_called-twice.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-shared-lib.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-lib.c // CHECK-NEXT: -: 0:Graph:instrprof-shared-lib.gcno // CHECK-NEXT: -: 0:Data:instrprof-shared-lib.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-lib_in-loop.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-lib_in-loop.c.gcov index 0fc7ccbabab2..69350471312e 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-lib_in-loop.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-lib_in-loop.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-shared-lib.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-lib.c // CHECK-NEXT: -: 0:Graph:instrprof-shared-lib.gcno // CHECK-NEXT: -: 0:Data:instrprof-shared-lib.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov index 6027c64af61b..0f9826dad80f 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-shared-main-gcov-flush.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-main-gcov-flush.c // CHECK-NEXT: -: 0:Graph:instrprof-shared-main-gcov-flush.gcno // CHECK-NEXT: -: 0:Data:instrprof-shared-main-gcov-flush.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov index fba3f3fe2812..5cc26580b222 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-shared-main-gcov-flush.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-main-gcov-flush.c // CHECK-NEXT: -: 0:Graph:instrprof-shared-main-gcov-flush.gcno // CHECK-NEXT: -: 0:Data:instrprof-shared-main-gcov-flush.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov index 86beda22a1ad..7a6800c47f84 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-shared-main-gcov-flush.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-main-gcov-flush.c // CHECK-NEXT: -: 0:Graph:instrprof-shared-main-gcov-flush.gcno // CHECK-NEXT: -: 0:Data:instrprof-shared-main-gcov-flush.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov index 2e55741cc536..49995fdc8635 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-shared-main-gcov-flush.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-main-gcov-flush.c // CHECK-NEXT: -: 0:Graph:instrprof-shared-main-gcov-flush.gcno // CHECK-NEXT: -: 0:Data:instrprof-shared-main-gcov-flush.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-shared-main.c.gcov b/compiler-rt/test/profile/Inputs/instrprof-shared-main.c.gcov index 05cd4e31d6eb..a31a60238809 100644 --- a/compiler-rt/test/profile/Inputs/instrprof-shared-main.c.gcov +++ b/compiler-rt/test/profile/Inputs/instrprof-shared-main.c.gcov @@ -1,4 +1,4 @@ -// CHECK: -: 0:Source:{{.*}}Inputs/instrprof-shared-main.c +// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-main.c // CHECK-NEXT: -: 0:Graph:instrprof-shared-main.gcno // CHECK-NEXT: -: 0:Data:instrprof-shared-main.gcda // CHECK-NEXT: -: 0:Runs:1 diff --git a/compiler-rt/test/profile/Inputs/instrprof-visibility-helper.cpp b/compiler-rt/test/profile/Posix/Inputs/instrprof-visibility-helper.cpp similarity index 100% rename from compiler-rt/test/profile/Inputs/instrprof-visibility-helper.cpp rename to compiler-rt/test/profile/Posix/Inputs/instrprof-visibility-helper.cpp diff --git a/compiler-rt/test/profile/instrprof-dlopen-dlclose-gcov.test b/compiler-rt/test/profile/Posix/instrprof-dlopen-dlclose-gcov.test similarity index 54% rename from compiler-rt/test/profile/instrprof-dlopen-dlclose-gcov.test rename to compiler-rt/test/profile/Posix/instrprof-dlopen-dlclose-gcov.test index 36b5dbd262df..b845303a8afd 100644 --- a/compiler-rt/test/profile/instrprof-dlopen-dlclose-gcov.test +++ b/compiler-rt/test/profile/Posix/instrprof-dlopen-dlclose-gcov.test @@ -4,30 +4,30 @@ XFAIL: netbsd RUN: mkdir -p %t.d RUN: cd %t.d -RUN: %clang --coverage -o func.shared -fPIC -shared %S/Inputs/instrprof-dlopen-func.c -RUN: %clang --coverage -o func2.shared -fPIC -shared %S/Inputs/instrprof-dlopen-func2.c -RUN: %clang --coverage -o func3.shared -fPIC -shared %S/Inputs/instrprof-dlopen-func3.c -RUN: %clang --coverage -o %t -fPIC -rpath %t.d %S/Inputs/instrprof-dlopen-dlclose-main.c +RUN: %clang --coverage -o func.shared -fPIC -shared %S/../Inputs/instrprof-dlopen-func.c +RUN: %clang --coverage -o func2.shared -fPIC -shared %S/../Inputs/instrprof-dlopen-func2.c +RUN: %clang --coverage -o func3.shared -fPIC -shared %S/../Inputs/instrprof-dlopen-func3.c +RUN: %clang --coverage -o %t -fPIC -rpath %t.d %S/../Inputs/instrprof-dlopen-dlclose-main.c # Test with two dlopened libraries. RUN: rm -f instrprof-dlopen-dlclose-main.gcda instrprof-dlopen-func.gcda instrprof-dlopen-func2.gcda RUN: %run %t RUN: llvm-cov gcov instrprof-dlopen-dlclose-main.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-dlclose-main.c.gcov %S/Inputs/instrprof-dlopen-dlclose-main.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-dlclose-main.c.gcov %S/../Inputs/instrprof-dlopen-dlclose-main.c.gcov RUN: llvm-cov gcov instrprof-dlopen-func.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func.c.gcov %S/Inputs/instrprof-dlopen-func.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func.c.gcov %S/../Inputs/instrprof-dlopen-func.c.gcov RUN: llvm-cov gcov instrprof-dlopen-func2.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/Inputs/instrprof-dlopen-func2.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/../Inputs/instrprof-dlopen-func2.c.gcov # Test with three dlopened libraries. -RUN: %clang -DUSE_LIB3 --coverage -o %t -fPIC -rpath %t.d %S/Inputs/instrprof-dlopen-dlclose-main.c +RUN: %clang -DUSE_LIB3 --coverage -o %t -fPIC -rpath %t.d %S/../Inputs/instrprof-dlopen-dlclose-main.c RUN: rm -f instrprof-dlopen-dlclose-main.gcda instrprof-dlopen-func.gcda instrprof-dlopen-func2.gcda instrprof-dlopen-func3.gcda RUN: %run %t RUN: llvm-cov gcov instrprof-dlopen-dlclose-main.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-dlclose-main.c.gcov %S/Inputs/instrprof-dlopen-dlclose-main_three-libs.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-dlclose-main.c.gcov %S/../Inputs/instrprof-dlopen-dlclose-main_three-libs.c.gcov RUN: llvm-cov gcov instrprof-dlopen-func.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func.c.gcov %S/Inputs/instrprof-dlopen-func.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func.c.gcov %S/../Inputs/instrprof-dlopen-func.c.gcov RUN: llvm-cov gcov instrprof-dlopen-func2.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/Inputs/instrprof-dlopen-func2.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/../Inputs/instrprof-dlopen-func2.c.gcov RUN: llvm-cov gcov instrprof-dlopen-func3.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/Inputs/instrprof-dlopen-func3.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-dlopen-func2.c.gcov %S/../Inputs/instrprof-dlopen-func3.c.gcov diff --git a/compiler-rt/test/profile/instrprof-dlopen.test b/compiler-rt/test/profile/Posix/instrprof-dlopen.test similarity index 59% rename from compiler-rt/test/profile/instrprof-dlopen.test rename to compiler-rt/test/profile/Posix/instrprof-dlopen.test index ba386e34773b..d84ed748ea71 100644 --- a/compiler-rt/test/profile/instrprof-dlopen.test +++ b/compiler-rt/test/profile/Posix/instrprof-dlopen.test @@ -1,11 +1,11 @@ RUN: mkdir -p %t.d -RUN: %clang_profgen -o %t.d/func.shared -fPIC -shared %S/Inputs/instrprof-dlopen-func.c -RUN: %clang_profgen -o %t.d/func2.shared -fPIC -shared %S/Inputs/instrprof-dlopen-func2.c -RUN: %clang -o %t-local -fPIC -DDLOPEN_FUNC_DIR=\"%t.d\" -DDLOPEN_FLAGS="RTLD_LAZY | RTLD_LOCAL" %S/Inputs/instrprof-dlopen-main.c -RUN: %clang -o %t-global -fPIC -DDLOPEN_FUNC_DIR=\"%t.d\" -DDLOPEN_FLAGS="RTLD_LAZY | RTLD_GLOBAL" %S/Inputs/instrprof-dlopen-main.c +RUN: %clang_profgen -o %t.d/func.shared -fPIC -shared %S/../Inputs/instrprof-dlopen-func.c +RUN: %clang_profgen -o %t.d/func2.shared -fPIC -shared %S/../Inputs/instrprof-dlopen-func2.c +RUN: %clang -o %t-local -fPIC -DDLOPEN_FUNC_DIR=\"%t.d\" -DDLOPEN_FLAGS="RTLD_LAZY | RTLD_LOCAL" %S/../Inputs/instrprof-dlopen-main.c +RUN: %clang -o %t-global -fPIC -DDLOPEN_FUNC_DIR=\"%t.d\" -DDLOPEN_FLAGS="RTLD_LAZY | RTLD_GLOBAL" %S/../Inputs/instrprof-dlopen-main.c -RUN: %clang -c -o %t.d/main.o %S/Inputs/instrprof-dlopen-main.c -RUN: %clang_profgen -o %t-static %S/Inputs/instrprof-dlopen-func.c %S/Inputs/instrprof-dlopen-func2.c %t.d/main.o +RUN: %clang -c -o %t.d/main.o %S/../Inputs/instrprof-dlopen-main.c +RUN: %clang_profgen -o %t-static %S/../Inputs/instrprof-dlopen-func.c %S/../Inputs/instrprof-dlopen-func2.c %t.d/main.o RUN: env LLVM_PROFILE_FILE=%t-static.profraw %run %t-static RUN: env LLVM_PROFILE_FILE=%t-local.profraw %run %t-local @@ -15,20 +15,20 @@ RUN: llvm-profdata merge -o %t-static.profdata %t-static.profraw RUN: llvm-profdata merge -o %t-local.profdata %t-local.profraw RUN: llvm-profdata merge -o %t-global.profdata %t-global.profraw -RUN: %clang_profuse=%t-static.profdata -o %t-func.static.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-func.c -RUN: %clang_profuse=%t-local.profdata -o %t-func.local.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-func.c -RUN: %clang_profuse=%t-global.profdata -o %t-func.global.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-func.c +RUN: %clang_profuse=%t-static.profdata -o %t-func.static.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-func.c +RUN: %clang_profuse=%t-local.profdata -o %t-func.local.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-func.c +RUN: %clang_profuse=%t-global.profdata -o %t-func.global.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-func.c RUN: diff %t-func.static.ll %t-func.local.ll RUN: diff %t-func.static.ll %t-func.global.ll -RUN: %clang_profuse=%t-static.profdata -o %t-func2.static.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-func2.c -RUN: %clang_profuse=%t-local.profdata -o %t-func2.local.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-func2.c -RUN: %clang_profuse=%t-global.profdata -o %t-func2.global.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-func2.c +RUN: %clang_profuse=%t-static.profdata -o %t-func2.static.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-func2.c +RUN: %clang_profuse=%t-local.profdata -o %t-func2.local.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-func2.c +RUN: %clang_profuse=%t-global.profdata -o %t-func2.global.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-func2.c RUN: diff %t-func2.static.ll %t-func2.local.ll RUN: diff %t-func2.static.ll %t-func2.global.ll -RUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-main.c -RUN: %clang_profuse=%t-local.profdata -o %t-main.local.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-main.c -RUN: %clang_profuse=%t-local.profdata -o %t-main.global.ll -S -emit-llvm %S/Inputs/instrprof-dlopen-main.c +RUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-main.c +RUN: %clang_profuse=%t-local.profdata -o %t-main.local.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-main.c +RUN: %clang_profuse=%t-local.profdata -o %t-main.global.ll -S -emit-llvm %S/../Inputs/instrprof-dlopen-main.c RUN: diff %t-main.static.ll %t-main.local.ll RUN: diff %t-main.static.ll %t-main.global.ll diff --git a/compiler-rt/test/profile/instrprof-dynamic-one-shared.test b/compiler-rt/test/profile/Posix/instrprof-dynamic-one-shared.test similarity index 59% rename from compiler-rt/test/profile/instrprof-dynamic-one-shared.test rename to compiler-rt/test/profile/Posix/instrprof-dynamic-one-shared.test index 38be4fe8bc4e..16ae64f471a9 100644 --- a/compiler-rt/test/profile/instrprof-dynamic-one-shared.test +++ b/compiler-rt/test/profile/Posix/instrprof-dynamic-one-shared.test @@ -1,8 +1,8 @@ RUN: mkdir -p %t.d -RUN: %clang_profgen -o %t.d/a.shared -fPIC -shared %S/Inputs/instrprof-dynamic-a.cpp -RUN: %clang_profgen -o %t-shared -fPIC -rpath %t.d %t.d/a.shared %S/Inputs/instrprof-dynamic-b.cpp %S/Inputs/instrprof-dynamic-main.cpp +RUN: %clang_profgen -o %t.d/a.shared -fPIC -shared %S/../Inputs/instrprof-dynamic-a.cpp +RUN: %clang_profgen -o %t-shared -fPIC -rpath %t.d %t.d/a.shared %S/../Inputs/instrprof-dynamic-b.cpp %S/../Inputs/instrprof-dynamic-main.cpp -RUN: %clang_profgen -o %t-static %S/Inputs/instrprof-dynamic-a.cpp %S/Inputs/instrprof-dynamic-b.cpp %S/Inputs/instrprof-dynamic-main.cpp +RUN: %clang_profgen -o %t-static %S/../Inputs/instrprof-dynamic-a.cpp %S/../Inputs/instrprof-dynamic-b.cpp %S/../Inputs/instrprof-dynamic-main.cpp RUN: env LLVM_PROFILE_FILE=%t-static.profraw %run %t-static RUN: env LLVM_PROFILE_FILE=%t-shared.profraw %run %t-shared @@ -10,14 +10,14 @@ RUN: env LLVM_PROFILE_FILE=%t-shared.profraw %run %t-shared RUN: llvm-profdata merge -o %t-static.profdata %t-static.profraw RUN: llvm-profdata merge -o %t-shared.profdata %t-shared.profraw -RUN: %clang_profuse=%t-static.profdata -o %t-a.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-a.cpp -RUN: %clang_profuse=%t-shared.profdata -o %t-a.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-a.cpp +RUN: %clang_profuse=%t-static.profdata -o %t-a.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-a.cpp +RUN: %clang_profuse=%t-shared.profdata -o %t-a.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-a.cpp RUN: diff %t-a.static.ll %t-a.shared.ll -RUN: %clang_profuse=%t-static.profdata -o %t-b.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-b.cpp -RUN: %clang_profuse=%t-shared.profdata -o %t-b.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-b.cpp +RUN: %clang_profuse=%t-static.profdata -o %t-b.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-b.cpp +RUN: %clang_profuse=%t-shared.profdata -o %t-b.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-b.cpp RUN: diff %t-b.static.ll %t-b.shared.ll -RUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-main.cpp -RUN: %clang_profuse=%t-shared.profdata -o %t-main.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-main.cpp +RUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-main.cpp +RUN: %clang_profuse=%t-shared.profdata -o %t-main.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-main.cpp RUN: diff %t-main.static.ll %t-main.shared.ll diff --git a/compiler-rt/test/profile/instrprof-dynamic-two-shared.test b/compiler-rt/test/profile/Posix/instrprof-dynamic-two-shared.test similarity index 56% rename from compiler-rt/test/profile/instrprof-dynamic-two-shared.test rename to compiler-rt/test/profile/Posix/instrprof-dynamic-two-shared.test index 830359dec44f..dd7bacc8aaa7 100644 --- a/compiler-rt/test/profile/instrprof-dynamic-two-shared.test +++ b/compiler-rt/test/profile/Posix/instrprof-dynamic-two-shared.test @@ -1,9 +1,9 @@ RUN: mkdir -p %t.d -RUN: %clang_profgen -o %t.d/a.shared -fPIC -shared %S/Inputs/instrprof-dynamic-a.cpp -RUN: %clang_profgen -o %t.d/b.shared -fPIC -shared %S/Inputs/instrprof-dynamic-b.cpp -RUN: %clang_profgen -o %t-shared -fPIC -rpath %t.d %t.d/a.shared %t.d/b.shared %S/Inputs/instrprof-dynamic-main.cpp +RUN: %clang_profgen -o %t.d/a.shared -fPIC -shared %S/../Inputs/instrprof-dynamic-a.cpp +RUN: %clang_profgen -o %t.d/b.shared -fPIC -shared %S/../Inputs/instrprof-dynamic-b.cpp +RUN: %clang_profgen -o %t-shared -fPIC -rpath %t.d %t.d/a.shared %t.d/b.shared %S/../Inputs/instrprof-dynamic-main.cpp -RUN: %clang_profgen -o %t-static %S/Inputs/instrprof-dynamic-a.cpp %S/Inputs/instrprof-dynamic-b.cpp %S/Inputs/instrprof-dynamic-main.cpp +RUN: %clang_profgen -o %t-static %S/../Inputs/instrprof-dynamic-a.cpp %S/../Inputs/instrprof-dynamic-b.cpp %S/../Inputs/instrprof-dynamic-main.cpp RUN: env LLVM_PROFILE_FILE=%t-static.profraw %run %t-static RUN: env LLVM_PROFILE_FILE=%t-shared.profraw %run %t-shared @@ -11,14 +11,14 @@ RUN: env LLVM_PROFILE_FILE=%t-shared.profraw %run %t-shared RUN: llvm-profdata merge -o %t-static.profdata %t-static.profraw RUN: llvm-profdata merge -o %t-shared.profdata %t-shared.profraw -RUN: %clang_profuse=%t-static.profdata -o %t-a.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-a.cpp -RUN: %clang_profuse=%t-shared.profdata -o %t-a.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-a.cpp +RUN: %clang_profuse=%t-static.profdata -o %t-a.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-a.cpp +RUN: %clang_profuse=%t-shared.profdata -o %t-a.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-a.cpp RUN: diff %t-a.static.ll %t-a.shared.ll -RUN: %clang_profuse=%t-static.profdata -o %t-b.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-b.cpp -RUN: %clang_profuse=%t-shared.profdata -o %t-b.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-b.cpp +RUN: %clang_profuse=%t-static.profdata -o %t-b.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-b.cpp +RUN: %clang_profuse=%t-shared.profdata -o %t-b.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-b.cpp RUN: diff %t-b.static.ll %t-b.shared.ll -RUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-main.cpp -RUN: %clang_profuse=%t-shared.profdata -o %t-main.shared.ll -S -emit-llvm %S/Inputs/instrprof-dynamic-main.cpp +RUN: %clang_profuse=%t-static.profdata -o %t-main.static.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-main.cpp +RUN: %clang_profuse=%t-shared.profdata -o %t-main.shared.ll -S -emit-llvm %S/../Inputs/instrprof-dynamic-main.cpp RUN: diff %t-main.static.ll %t-main.shared.ll diff --git a/compiler-rt/test/profile/instrprof-set-filename-shared.test b/compiler-rt/test/profile/Posix/instrprof-set-filename-shared.test similarity index 81% rename from compiler-rt/test/profile/instrprof-set-filename-shared.test rename to compiler-rt/test/profile/Posix/instrprof-set-filename-shared.test index afcb4b4fd2d6..439c6c0dda8f 100644 --- a/compiler-rt/test/profile/instrprof-set-filename-shared.test +++ b/compiler-rt/test/profile/Posix/instrprof-set-filename-shared.test @@ -1,7 +1,7 @@ # Test that __llvm_profile_set_filename is honored by shared libary too. RUN: mkdir -p %t.d -RUN: %clang_profgen=%t.shared.profraw -fPIC -shared -o %t.d/t.shared %S/Inputs/instrprof-dlopen-func.c -RUN: %clang_profgen -DCALL_SHARED -o %t.m -O3 -rpath %t.d %t.d/t.shared %S/instrprof-set-filename.c +RUN: %clang_profgen=%t.shared.profraw -fPIC -shared -o %t.d/t.shared %S/../Inputs/instrprof-dlopen-func.c +RUN: %clang_profgen -DCALL_SHARED -o %t.m -O3 -rpath %t.d %t.d/t.shared %S/../instrprof-set-filename.c RUN: %run %t.m %t.main.profraw RUN: llvm-profdata show %t.main.profraw | FileCheck --check-prefix=SHARED %s diff --git a/compiler-rt/test/profile/instrprof-shared-gcov-flush.test b/compiler-rt/test/profile/Posix/instrprof-shared-gcov-flush.test similarity index 67% rename from compiler-rt/test/profile/instrprof-shared-gcov-flush.test rename to compiler-rt/test/profile/Posix/instrprof-shared-gcov-flush.test index 542db0412437..8d530fd452a7 100644 --- a/compiler-rt/test/profile/instrprof-shared-gcov-flush.test +++ b/compiler-rt/test/profile/Posix/instrprof-shared-gcov-flush.test @@ -4,49 +4,49 @@ XFAIL: darwin RUN: mkdir -p %t.d RUN: cd %t.d -RUN: %clang --coverage -o libfunc.so -fPIC -shared %S/Inputs/instrprof-shared-lib.c +RUN: %clang --coverage -o libfunc.so -fPIC -shared %S/../Inputs/instrprof-shared-lib.c RUN: test -f instrprof-shared-lib.gcno # Test the case where we exit abruptly after calling __gcov_flush, which means we don't write out the counters at exit. -RUN: %clang -DEXIT_ABRUPTLY -DSHARED_CALL_BEFORE_GCOV_FLUSH -DSHARED_CALL_AFTER_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/Inputs/instrprof-shared-main-gcov-flush.c +RUN: %clang -DEXIT_ABRUPTLY -DSHARED_CALL_BEFORE_GCOV_FLUSH -DSHARED_CALL_AFTER_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/../Inputs/instrprof-shared-main-gcov-flush.c RUN: test -f instrprof-shared-main-gcov-flush.gcno RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda RUN: %run %t RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/../Inputs/instrprof-shared-main-gcov-flush_no-writeout.c.gcov RUN: llvm-cov gcov instrprof-shared-lib.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/Inputs/instrprof-shared-lib.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/../Inputs/instrprof-shared-lib.c.gcov # Test the case where we exit normally and we have a call to the shared library function before __gcov_flush. -RUN: %clang -DSHARED_CALL_BEFORE_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/Inputs/instrprof-shared-main-gcov-flush.c +RUN: %clang -DSHARED_CALL_BEFORE_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/../Inputs/instrprof-shared-main-gcov-flush.c RUN: test -f instrprof-shared-main-gcov-flush.gcno RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda RUN: %run %t RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/../Inputs/instrprof-shared-main-gcov-flush_shared-call-before.c.gcov RUN: llvm-cov gcov instrprof-shared-lib.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/Inputs/instrprof-shared-lib.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/../Inputs/instrprof-shared-lib.c.gcov # Test the case where we exit normally and we have a call to the shared library function after __gcov_flush. -RUN: %clang -DSHARED_CALL_AFTER_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/Inputs/instrprof-shared-main-gcov-flush.c +RUN: %clang -DSHARED_CALL_AFTER_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/../Inputs/instrprof-shared-main-gcov-flush.c RUN: test -f instrprof-shared-main-gcov-flush.gcno RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda RUN: %run %t RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/../Inputs/instrprof-shared-main-gcov-flush_shared-call-after.c.gcov RUN: llvm-cov gcov instrprof-shared-lib.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/Inputs/instrprof-shared-lib.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/../Inputs/instrprof-shared-lib.c.gcov # Test the case where we exit normally and we have calls to the shared library function before and after __gcov_flush. -RUN: %clang -DSHARED_CALL_BEFORE_GCOV_FLUSH -DSHARED_CALL_AFTER_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/Inputs/instrprof-shared-main-gcov-flush.c +RUN: %clang -DSHARED_CALL_BEFORE_GCOV_FLUSH -DSHARED_CALL_AFTER_GCOV_FLUSH --coverage -o %t -L%t.d -rpath %t.d -lfunc %S/../Inputs/instrprof-shared-main-gcov-flush.c RUN: test -f instrprof-shared-main-gcov-flush.gcno RUN: rm -f instrprof-shared-main-gcov-flush.gcda instrprof-shared-lib.gcda RUN: %run %t RUN: llvm-cov gcov instrprof-shared-main-gcov-flush.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-main-gcov-flush.c.gcov %S/../Inputs/instrprof-shared-main-gcov-flush_shared-call-before-after.c.gcov RUN: llvm-cov gcov instrprof-shared-lib.gcda -RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/Inputs/instrprof-shared-lib_called-twice.c.gcov +RUN: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-shared-lib.c.gcov %S/../Inputs/instrprof-shared-lib_called-twice.c.gcov diff --git a/compiler-rt/test/profile/instrprof-shared.test b/compiler-rt/test/profile/Posix/instrprof-shared.test similarity index 80% rename from compiler-rt/test/profile/instrprof-shared.test rename to compiler-rt/test/profile/Posix/instrprof-shared.test index b3f0b9ab4bcc..7087fa2fa33e 100644 --- a/compiler-rt/test/profile/instrprof-shared.test +++ b/compiler-rt/test/profile/Posix/instrprof-shared.test @@ -14,18 +14,18 @@ enabled behave as expected. """ RUN: mkdir -p %t.d -RUN: %clang_profgen -o %t.d/libt-instr.so -fPIC -shared %S/Inputs/instrprof-shared-lib.c -RUN: %clang -o %t.d/libt-no-instr1.so -fPIC -shared %S/Inputs/instrprof-shared-lib.c -RUN: %clang -c -o %t.d/instrprof-shared-lib-no-instr2.o -fPIC %S/Inputs/instrprof-shared-lib.c +RUN: %clang_profgen -o %t.d/libt-instr.so -fPIC -shared %S/../Inputs/instrprof-shared-lib.c +RUN: %clang -o %t.d/libt-no-instr1.so -fPIC -shared %S/../Inputs/instrprof-shared-lib.c +RUN: %clang -c -o %t.d/instrprof-shared-lib-no-instr2.o -fPIC %S/../Inputs/instrprof-shared-lib.c RUN: %clang_profgen -o %t.d/libt-no-instr2.so -fPIC -shared %t.d/instrprof-shared-lib-no-instr2.o -RUN: %clang_profgen -o %t-instr-instr -L%t.d -rpath %t.d -lt-instr %S/Inputs/instrprof-shared-main.c -RUN: %clang_profgen -o %t-instr-no-instr1 -L%t.d -rpath %t.d -lt-no-instr1 %S/Inputs/instrprof-shared-main.c -RUN: %clang_profgen -o %t-instr-no-instr2 -L%t.d -rpath %t.d -lt-no-instr2 %S/Inputs/instrprof-shared-main.c -RUN: %clang -o %t-no-instr1-instr -L%t.d -rpath %t.d -lt-instr %S/Inputs/instrprof-shared-main.c -RUN: %clang -o %t-no-instr1-no-instr1 -L%t.d -rpath %t.d -lt-no-instr1 %S/Inputs/instrprof-shared-main.c -RUN: %clang -o %t-no-instr1-no-instr2 -L%t.d -rpath %t.d -lt-no-instr2 %S/Inputs/instrprof-shared-main.c -RUN: %clang -c -o %t.d/instrprof-shared-main-no-instr2.o %S/Inputs/instrprof-shared-main.c +RUN: %clang_profgen -o %t-instr-instr -L%t.d -rpath %t.d -lt-instr %S/../Inputs/instrprof-shared-main.c +RUN: %clang_profgen -o %t-instr-no-instr1 -L%t.d -rpath %t.d -lt-no-instr1 %S/../Inputs/instrprof-shared-main.c +RUN: %clang_profgen -o %t-instr-no-instr2 -L%t.d -rpath %t.d -lt-no-instr2 %S/../Inputs/instrprof-shared-main.c +RUN: %clang -o %t-no-instr1-instr -L%t.d -rpath %t.d -lt-instr %S/../Inputs/instrprof-shared-main.c +RUN: %clang -o %t-no-instr1-no-instr1 -L%t.d -rpath %t.d -lt-no-instr1 %S/../Inputs/instrprof-shared-main.c +RUN: %clang -o %t-no-instr1-no-instr2 -L%t.d -rpath %t.d -lt-no-instr2 %S/../Inputs/instrprof-shared-main.c +RUN: %clang -c -o %t.d/instrprof-shared-main-no-instr2.o %S/../Inputs/instrprof-shared-main.c RUN: %clang -o %t-no-instr2-instr -L%t.d -rpath %t.d -lt-instr %t.d/instrprof-shared-main-no-instr2.o RUN: %clang -o %t-no-instr2-no-instr1 -L%t.d -rpath %t.d -lt-no-instr1 %t.d/instrprof-shared-main-no-instr2.o RUN: %clang -o %t-no-instr2-no-instr2 -L%t.d -rpath %t.d -lt-no-instr2 %t.d/instrprof-shared-main-no-instr2.o @@ -57,13 +57,13 @@ RUN: llvm-profdata show -counts --function foo %t-instr-instr.profdata | grep -v RUN: llvm-profdata show -counts --function foo %t-no-instr1-instr.profdata | grep -v 'Total\|Maximum' > %t-foo-2 RUN: llvm-profdata show -counts --function foo %t-no-instr2-instr.profdata | grep -v 'Total\|Maximum' > %t-foo-3 -RUN: %clang_profuse=%t-instr-instr.profdata -o %t-main-instr-instr.ll -S -emit-llvm %S/Inputs/instrprof-shared-main.c -RUN: %clang_profuse=%t-instr-no-instr1.profdata -o %t-main-instr-no-instr1.ll -S -emit-llvm %S/Inputs/instrprof-shared-main.c -RUN: %clang_profuse=%t-instr-no-instr2.profdata -o %t-main-instr-no-instr2.ll -S -emit-llvm %S/Inputs/instrprof-shared-main.c -RUN: %clang_profuse=%t-instr-instr.profdata -o %t-lib-instr-instr.ll -S -emit-llvm %S/Inputs/instrprof-shared-lib.c -RUN: %clang_profuse=%t-no-instr1-instr.profdata -o %t-lib-no-instr1-instr.ll -S -emit-llvm %S/Inputs/instrprof-shared-lib.c -RUN: %clang_profuse=%t-no-instr2-instr.profdata -o %t-lib-no-instr2-instr.ll -S -emit-llvm %S/Inputs/instrprof-shared-lib.c -RUN: %clang_profuse=%t-instr-instr.profdata -o %t-lib-instr-instr.ll -S -emit-llvm %S/Inputs/instrprof-shared-lib.c +RUN: %clang_profuse=%t-instr-instr.profdata -o %t-main-instr-instr.ll -S -emit-llvm %S/../Inputs/instrprof-shared-main.c +RUN: %clang_profuse=%t-instr-no-instr1.profdata -o %t-main-instr-no-instr1.ll -S -emit-llvm %S/../Inputs/instrprof-shared-main.c +RUN: %clang_profuse=%t-instr-no-instr2.profdata -o %t-main-instr-no-instr2.ll -S -emit-llvm %S/../Inputs/instrprof-shared-main.c +RUN: %clang_profuse=%t-instr-instr.profdata -o %t-lib-instr-instr.ll -S -emit-llvm %S/../Inputs/instrprof-shared-lib.c +RUN: %clang_profuse=%t-no-instr1-instr.profdata -o %t-lib-no-instr1-instr.ll -S -emit-llvm %S/../Inputs/instrprof-shared-lib.c +RUN: %clang_profuse=%t-no-instr2-instr.profdata -o %t-lib-no-instr2-instr.ll -S -emit-llvm %S/../Inputs/instrprof-shared-lib.c +RUN: %clang_profuse=%t-instr-instr.profdata -o %t-lib-instr-instr.ll -S -emit-llvm %S/../Inputs/instrprof-shared-lib.c RUN: diff %t-main-instr-no-instr1.ll %t-main-instr-no-instr2.ll RUN: diff %t-lib-no-instr1-instr.ll %t-lib-no-instr2-instr.ll diff --git a/compiler-rt/test/profile/instrprof-value-prof-shared.test b/compiler-rt/test/profile/Posix/instrprof-value-prof-shared.test similarity index 64% rename from compiler-rt/test/profile/instrprof-value-prof-shared.test rename to compiler-rt/test/profile/Posix/instrprof-value-prof-shared.test index a45b0d55b236..34abe82952a2 100644 --- a/compiler-rt/test/profile/instrprof-value-prof-shared.test +++ b/compiler-rt/test/profile/Posix/instrprof-value-prof-shared.test @@ -1,52 +1,52 @@ // RUN: mkdir -p %t.d -// RUN: %clang_profgen -O2 -mllvm -enable-value-profiling=true -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.shared -DSHARED_LIB %S/Inputs/instrprof-value-prof-real.c -// RUN: %clang_profgen -O2 -mllvm -enable-value-profiling=true -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -o %t -rpath %t.d %t.d/t.shared -DCALL_SHARED %S/Inputs/instrprof-value-prof-real.c +// RUN: %clang_profgen -O2 -mllvm -enable-value-profiling=true -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.shared -DSHARED_LIB %S/../Inputs/instrprof-value-prof-real.c +// RUN: %clang_profgen -O2 -mllvm -enable-value-profiling=true -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -o %t -rpath %t.d %t.d/t.shared -DCALL_SHARED %S/../Inputs/instrprof-value-prof-real.c // RUN: env LLVM_PROFILE_FILE=%t.profraw LLVM_VP_MAX_NUM_VALS_PER_SITE=255 %run %t // RUN: llvm-profdata merge -o %t.profdata %t.profraw -// RUN: llvm-profdata show --all-functions -ic-targets %t.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c -// RUN: llvm-profdata show --all-functions -ic-targets %t.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=SHARED +// RUN: llvm-profdata show --all-functions -ic-targets %t.profdata | FileCheck %S/../Inputs/instrprof-value-prof-real.c +// RUN: llvm-profdata show --all-functions -ic-targets %t.profdata | FileCheck %S/../Inputs/instrprof-value-prof-real.c --check-prefix=SHARED // IR level instrumentation -// RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.ir.shared -DSHARED_LIB %S/Inputs/instrprof-value-prof-real.c -// RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -rpath %t.d -o %t.ir %t.d/t.ir.shared -DCALL_SHARED %S/Inputs/instrprof-value-prof-real.c +// RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.ir.shared -DSHARED_LIB %S/../Inputs/instrprof-value-prof-real.c +// RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -rpath %t.d -o %t.ir %t.d/t.ir.shared -DCALL_SHARED %S/../Inputs/instrprof-value-prof-real.c // Profile data from shared library will be concatenated to the same raw file. // RUN: env LLVM_PROFILE_FILE=%t.ir.profraw LLVM_VP_MAX_NUM_VALS_PER_SITE=255 %run %t.ir // RUN: llvm-profdata merge -o %t.ir.profdata %t.ir.profraw -// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c +// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.profdata | FileCheck %S/../Inputs/instrprof-value-prof-real.c // RUN: llvm-profdata merge -text %t.ir.profdata -o %t.ir.proftxt -// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=SHARED -// RUN: FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.proftxt +// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.profdata | FileCheck %S/../Inputs/instrprof-value-prof-real.c --check-prefix=SHARED +// RUN: FileCheck %S/../Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.proftxt // Same as above but with profile online merging enabled. // RUN: rm -fr %t.prof/ // RUN: mkdir -p %t.prof/ -// RUN: %clang_pgogen=%t.prof -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.ir.m.shared -DSHARED_LIB %S/Inputs/instrprof-value-prof-real.c -// RUN: %clang_pgogen=%t.prof -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -rpath %t.d -o %t.ir.m %t.d/t.ir.m.shared -DCALL_SHARED %S/Inputs/instrprof-value-prof-real.c +// RUN: %clang_pgogen=%t.prof -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.ir.m.shared -DSHARED_LIB %S/../Inputs/instrprof-value-prof-real.c +// RUN: %clang_pgogen=%t.prof -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -rpath %t.d -o %t.ir.m %t.d/t.ir.m.shared -DCALL_SHARED %S/../Inputs/instrprof-value-prof-real.c // RUN: env LLVM_VP_MAX_NUM_VALS_PER_SITE=255 %run %t.ir.m // RUN: llvm-profdata merge -o %t.ir.m.profdata -dump-input-file-list %t.prof/ | count 2 // RUN: llvm-profdata merge -o %t.ir.m.profdata %t.prof/ -// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.m.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c +// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.m.profdata | FileCheck %S/../Inputs/instrprof-value-prof-real.c // RUN: llvm-profdata merge -text %t.ir.m.profdata -o %t.ir.m.proftxt -// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.m.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=SHARED -// RUN: FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.m.proftxt +// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.m.profdata | FileCheck %S/../Inputs/instrprof-value-prof-real.c --check-prefix=SHARED +// RUN: FileCheck %S/../Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.m.proftxt // IR level instrumentation: dynamic memory allocation -// RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=false -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.ir.dyn.shared -DSHARED_LIB %S/Inputs/instrprof-value-prof-real.c -// RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=false -mllvm -vp-counters-per-site=256 -rpath %t.d -o %t.ir.dyn %t.d/t.ir.dyn.shared -DCALL_SHARED %S/Inputs/instrprof-value-prof-real.c +// RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=false -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.ir.dyn.shared -DSHARED_LIB %S/../Inputs/instrprof-value-prof-real.c +// RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=false -mllvm -vp-counters-per-site=256 -rpath %t.d -o %t.ir.dyn %t.d/t.ir.dyn.shared -DCALL_SHARED %S/../Inputs/instrprof-value-prof-real.c // RUN: env LLVM_PROFILE_FILE=%t.ir.dyn.profraw %run %t.ir.dyn // RUN: llvm-profdata merge -o %t.ir.dyn.profdata %t.ir.dyn.profraw -// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.dyn.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c +// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.dyn.profdata | FileCheck %S/../Inputs/instrprof-value-prof-real.c // RUN: llvm-profdata merge -text %t.ir.dyn.profdata -o %t.ir.dyn.proftxt -// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.dyn.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=SHARED -// RUN: FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.dyn.proftxt +// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.dyn.profdata | FileCheck %S/../Inputs/instrprof-value-prof-real.c --check-prefix=SHARED +// RUN: FileCheck %S/../Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.dyn.proftxt // IR level instrumentation: main program uses static counter, shared library uses dynamic memory alloc. -// RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=false -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.ir.dyn.shared -DSHARED_LIB %S/Inputs/instrprof-value-prof-real.c -// RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -rpath %t.d -o %t.ir.mixed %t.d/t.ir.dyn.shared -DCALL_SHARED %S/Inputs/instrprof-value-prof-real.c +// RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=false -mllvm -vp-counters-per-site=256 -fPIC -shared -o %t.d/t.ir.dyn.shared -DSHARED_LIB %S/../Inputs/instrprof-value-prof-real.c +// RUN: %clang_pgogen -O2 -mllvm -disable-vp=false -mllvm -vp-static-alloc=true -mllvm -vp-counters-per-site=256 -rpath %t.d -o %t.ir.mixed %t.d/t.ir.dyn.shared -DCALL_SHARED %S/../Inputs/instrprof-value-prof-real.c // RUN: env LLVM_PROFILE_FILE=%t.ir.mixed.profraw LLVM_VP_MAX_NUM_VALS_PER_SITE=255 %run %t.ir.mixed // RUN: llvm-profdata merge -o %t.ir.mixed.profdata %t.ir.mixed.profraw -// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.mixed.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c +// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.mixed.profdata | FileCheck %S/../Inputs/instrprof-value-prof-real.c // RUN: llvm-profdata merge -text %t.ir.mixed.profdata -o %t.ir.mixed.proftxt -// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.mixed.profdata | FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=SHARED -// RUN: FileCheck %S/Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.mixed.proftxt +// RUN: llvm-profdata show --all-functions -ic-targets %t.ir.mixed.profdata | FileCheck %S/../Inputs/instrprof-value-prof-real.c --check-prefix=SHARED +// RUN: FileCheck %S/../Inputs/instrprof-value-prof-real.c --check-prefix=IR < %t.ir.mixed.proftxt diff --git a/compiler-rt/test/profile/instrprof-visibility-kinds.inc b/compiler-rt/test/profile/Posix/instrprof-visibility-kinds.inc similarity index 100% rename from compiler-rt/test/profile/instrprof-visibility-kinds.inc rename to compiler-rt/test/profile/Posix/instrprof-visibility-kinds.inc diff --git a/compiler-rt/test/profile/instrprof-visibility.cpp b/compiler-rt/test/profile/Posix/instrprof-visibility.cpp similarity index 100% rename from compiler-rt/test/profile/instrprof-visibility.cpp rename to compiler-rt/test/profile/Posix/instrprof-visibility.cpp diff --git a/compiler-rt/test/profile/Posix/lit.local.cfg b/compiler-rt/test/profile/Posix/lit.local.cfg new file mode 100644 index 000000000000..60a9460820a6 --- /dev/null +++ b/compiler-rt/test/profile/Posix/lit.local.cfg @@ -0,0 +1,9 @@ +def getRoot(config): + if not config.parent: + return config + return getRoot(config.parent) + +root = getRoot(config) + +if root.host_os in ['Windows']: + config.unsupported = True diff --git a/compiler-rt/test/profile/instrprof-gcov-exceptions.test b/compiler-rt/test/profile/instrprof-gcov-exceptions.test index 20ca47a9528b..a3dcc55aaf5b 100644 --- a/compiler-rt/test/profile/instrprof-gcov-exceptions.test +++ b/compiler-rt/test/profile/instrprof-gcov-exceptions.test @@ -17,5 +17,5 @@ RUN: test -f instrprof-gcov-exceptions.gcno RUN: rm -f instrprof-gcov-exceptions.gcda RUN: %run %t RUN: llvm-cov gcov instrprof-gcov-exceptions.gcda -# The result should be the same, not using XFAIL as only this part of the test is failing. -RUN: not FileCheck --match-full-lines --strict-whitespace --input-file instrprof-gcov-exceptions.cpp.gcov %S/Inputs/instrprof-gcov-exceptions.cpp.gcov +# FIXME: The result should be the same, but they are not on some platforms. +RUNX: FileCheck --match-full-lines --strict-whitespace --input-file instrprof-gcov-exceptions.cpp.gcov %S/Inputs/instrprof-gcov-exceptions.cpp.gcov diff --git a/compiler-rt/test/profile/instrprof-icall-promo.test b/compiler-rt/test/profile/instrprof-icall-promo.test index d9b16f67782e..12e627157ed8 100644 --- a/compiler-rt/test/profile/instrprof-icall-promo.test +++ b/compiler-rt/test/profile/instrprof-icall-promo.test @@ -12,6 +12,9 @@ RUN: env LLVM_PROFILE_FILE=%t-icall2.profraw %run %t.gen.2 RUN: llvm-profdata merge -o %t-icall2.profdata %t-icall2.profraw RUN: %clangxx_profuse=%t-icall2.profdata -O2 -Rpass=pgo-icall-prom -c -o %t.2.use.o %S/Inputs/instrprof-icall-promo_2.cc 2>&1 | FileCheck %s +FIXME: Relies on vtable layout +XFAIL: msvc + # CHECK: Promote indirect call to diff --git a/compiler-rt/test/profile/instrprof-merge-match.test b/compiler-rt/test/profile/instrprof-merge-match.test index 8345620dcf07..5448af15893d 100644 --- a/compiler-rt/test/profile/instrprof-merge-match.test +++ b/compiler-rt/test/profile/instrprof-merge-match.test @@ -3,3 +3,5 @@ // RUN: %clang_profgen -o %t -L %t.d -rpath %t.d %S/Inputs/instrprof-merge-match.c -lt // RUN: %run %t +rpath isn't supported on Windows. +UNSUPPORTED: windows diff --git a/compiler-rt/test/profile/instrprof-merge.c b/compiler-rt/test/profile/instrprof-merge.c index ef24c83a1037..8f8d7f458c96 100644 --- a/compiler-rt/test/profile/instrprof-merge.c +++ b/compiler-rt/test/profile/instrprof-merge.c @@ -2,6 +2,9 @@ // RUN: %run %t %t.profraw 1 1 // RUN: llvm-profdata show --all-functions --counts %t.profraw | FileCheck %s +// FIXME: llvm-profdata exits with "Malformed instrumentation profile data" +// XFAIL: msvc + #include #include #include diff --git a/compiler-rt/test/profile/instrprof-merging.cpp b/compiler-rt/test/profile/instrprof-merging.cpp index 06f05ce612aa..75b818d1b103 100644 --- a/compiler-rt/test/profile/instrprof-merging.cpp +++ b/compiler-rt/test/profile/instrprof-merging.cpp @@ -21,6 +21,9 @@ // and prefer it over others.) When only limited coverage information is // available (just from one binary), don't try to guess any region counts. +// FIXME: Fails with: "Failed to load coverage: No coverage data found" +// XFAIL: windows + struct A { A() {} // V1: [[@LINE]]{{ *}}|{{ *}}1 // V1-ONLY: [[@LINE+1]]{{ *}}|{{ *}}| diff --git a/compiler-rt/test/profile/instrprof-path.c b/compiler-rt/test/profile/instrprof-path.c index 90cb1df198f0..e4dc8961212c 100644 --- a/compiler-rt/test/profile/instrprof-path.c +++ b/compiler-rt/test/profile/instrprof-path.c @@ -1,13 +1,13 @@ // RUN: %clang_pgogen -O2 -o %t.0 %s -// RUN: %clang_pgogen=%t.d1 -O2 -o %t.1 %s -// RUN: %clang_pgogen=%t.d1/%t.d2 -O2 -o %t.2 %s +// RUN: %clang_pgogen=%/t.d1 -O2 -o %t.1 %s +// RUN: %clang_pgogen=%/t.d1/%:t.d2 -O2 -o %t.2 %s // // RUN: %run %t.0 "" -// RUN: env LLVM_PROFILE_FILE=%t.d1/default.profraw %run %t.0 %t.d1/ -// RUN: env LLVM_PROFILE_FILE=%t.d1/%t.d2/default.profraw %run %t.0 %t.d1/%t.d2/ -// RUN: %run %t.1 %t.d1/ -// RUN: %run %t.2 %t.d1/%t.d2/ -// RUN: %run %t.2 %t.d1/%t.d2/ %t.d1/%t.d2/%t.d3/blah.profraw %t.d1/%t.d2/%t.d3/ +// RUN: env LLVM_PROFILE_FILE=%/t.d1/default.profraw %run %t.0 %/t.d1 +// RUN: env LLVM_PROFILE_FILE=%/t.d1/%:t.d2/default.profraw %run %t.0 %/t.d1/%:t.d2 +// RUN: %run %t.1 %/t.d1 +// RUN: %run %t.2 %/t.d1/%:t.d2 +// RUN: %run %t.2 %/t.d1/%:t.d2 %/t.d1/%:t.d2/%:t.d3/blah.profraw %/t.d1/%:t.d2/%:t.d3/ #include @@ -15,7 +15,6 @@ const char *__llvm_profile_get_path_prefix(); void __llvm_profile_set_filename(const char*); int main(int argc, const char *argv[]) { - int i; const char *expected; const char *prefix; if (argc < 2) @@ -24,7 +23,16 @@ int main(int argc, const char *argv[]) { expected = argv[1]; prefix = __llvm_profile_get_path_prefix(); - if (strcmp(prefix, expected)) + // The last character should be a trailing slash. Ignore it in the comparison + // since it could be '/' or '\\'. + int slashpos = strlen(prefix); + if (slashpos > 0) { + --slashpos; + if (prefix[slashpos] != '/' && prefix[slashpos] != '\\') + return 1; + } + + if (strncmp(prefix, expected, slashpos)) return 1; if (argc == 4) { diff --git a/compiler-rt/test/profile/instrprof-version-mismatch.c b/compiler-rt/test/profile/instrprof-version-mismatch.c index 81ae52119693..c63b299c76d7 100644 --- a/compiler-rt/test/profile/instrprof-version-mismatch.c +++ b/compiler-rt/test/profile/instrprof-version-mismatch.c @@ -1,6 +1,9 @@ // RUN: %clang_profgen -o %t -O3 %s // RUN: %run %t 1 2>&1 | FileCheck %s +// FIXME: Weak symbols are once again a portability problem for Windows. +// XFAIL: windows + // override the version variable with a bogus version: unsigned long long __llvm_profile_raw_version = 10000; int main(int argc, const char *argv[]) { diff --git a/compiler-rt/test/profile/instrprof-without-libc.c b/compiler-rt/test/profile/instrprof-without-libc.c index 0708833e2bfd..6e9c1dde01e6 100644 --- a/compiler-rt/test/profile/instrprof-without-libc.c +++ b/compiler-rt/test/profile/instrprof-without-libc.c @@ -5,6 +5,10 @@ // RUN: llvm-profdata merge -o %t.profdata %t.profraw // RUN: %clang_profuse=%t.profdata -o - -S -emit-llvm %s | FileCheck %s +// This usage of llvm-nm assumes executables have symbol tables. They do not in +// an MSVC environment, so we can't make this test portable. +// UNSUPPORTED: msvc + #include #include diff --git a/compiler-rt/test/profile/lit.cfg b/compiler-rt/test/profile/lit.cfg index 7449650a623c..d16a95b44920 100644 --- a/compiler-rt/test/profile/lit.cfg +++ b/compiler-rt/test/profile/lit.cfg @@ -67,7 +67,7 @@ config.substitutions.append( ("%clangxx_profuse=", build_invocation(clang_cxxfla config.substitutions.append( ("%clang_lto_profgen=", build_invocation(clang_cflags, True) + " -fprofile-instr-generate=") ) -if config.host_os not in ['Darwin', 'FreeBSD', 'Linux', 'NetBSD', 'SunOS']: +if config.host_os not in ['Windows', 'Darwin', 'FreeBSD', 'Linux', 'NetBSD', 'SunOS']: config.unsupported = True if config.target_arch in ['armv7l']: