[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
2019-02-08 01:52:05 +08:00
|
|
|
// CHECK: -: 0:Source:{{.*}}Inputs{{[/\\]}}instrprof-shared-main-gcov-flush.c
|
2018-07-10 22:12:03 +08:00
|
|
|
// 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
|
|
|
|
// CHECK-NEXT: -: 0:Programs:1
|
|
|
|
// CHECK-NEXT: -: 1:extern void foo(int n);
|
|
|
|
// CHECK-NEXT: -: 2:extern void __gcov_flush(void);
|
|
|
|
// CHECK-NEXT: -: 3:
|
|
|
|
// CHECK-NEXT: -: 4:int bar1 = 0;
|
|
|
|
// CHECK-NEXT: -: 5:int bar2 = 1;
|
|
|
|
// CHECK-NEXT: -: 6:
|
2018-10-11 16:53:55 +08:00
|
|
|
// CHECK-NEXT: 1: 7:void bar(int n) {
|
2018-07-10 22:12:03 +08:00
|
|
|
// CHECK-NEXT: 1: 8: if (n % 5 == 0)
|
|
|
|
// CHECK-NEXT: 1: 9: bar1++;
|
|
|
|
// CHECK-NEXT: -: 10: else
|
|
|
|
// CHECK-NEXT: #####: 11: bar2++;
|
2018-09-25 02:24:29 +08:00
|
|
|
// CHECK-NEXT: 1: 12:}
|
2018-07-10 22:12:03 +08:00
|
|
|
// CHECK-NEXT: -: 13:
|
2018-10-11 16:53:55 +08:00
|
|
|
// CHECK-NEXT: 1: 14:int main(int argc, char *argv[]) {
|
2018-07-10 22:12:03 +08:00
|
|
|
// CHECK-NEXT: -: 15:#ifdef SHARED_CALL_BEFORE_GCOV_FLUSH
|
|
|
|
// CHECK-NEXT: 1: 16: foo(1);
|
|
|
|
// CHECK-NEXT: -: 17:#endif
|
|
|
|
// CHECK-NEXT: -: 18:
|
|
|
|
// CHECK-NEXT: 1: 19: bar(5);
|
|
|
|
// CHECK-NEXT: -: 20:
|
|
|
|
// CHECK-NEXT: 1: 21: __gcov_flush();
|
|
|
|
// CHECK-NEXT: -: 22:
|
|
|
|
// CHECK-NEXT: 1: 23: bar(5);
|
|
|
|
// CHECK-NEXT: -: 24:
|
|
|
|
// CHECK-NEXT: -: 25:#ifdef SHARED_CALL_AFTER_GCOV_FLUSH
|
|
|
|
// CHECK-NEXT: 1: 26: foo(1);
|
|
|
|
// CHECK-NEXT: -: 27:#endif
|
|
|
|
// CHECK-NEXT: -: 28:
|
|
|
|
// CHECK-NEXT: -: 29:#ifdef EXIT_ABRUPTLY
|
|
|
|
// CHECK-NEXT: 1: 30: _exit(0);
|
|
|
|
// CHECK-NEXT: -: 31:#endif
|
|
|
|
// CHECK-NEXT: -: 32:
|
|
|
|
// CHECK-NEXT: -: 33: bar(5);
|
|
|
|
// CHECK-NEXT: -: 34:
|
|
|
|
// CHECK-NEXT: -: 35: return 0;
|
2019-04-11 11:04:04 +08:00
|
|
|
// CHECK-NEXT: -: 36:}
|