-
Notifications
You must be signed in to change notification settings - Fork 806
[SYCL][NFC] Use unique (or no at all) output files in LIT tests #7872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCL][NFC] Use unique (or no at all) output files in LIT tests #7872
Conversation
This fixes sporadic issue with `check-sycl` on Windows. Apparently we had a number of tests, which didn't specify `-o %t.out` and it caused some tests to write to the same default `a.exe` and fail with error like: ``` LINK : fatal error LNK1104: cannot open file 'a.exe' ``` To resolve this, switch most of such tests to use `-fsyntax-only` or explicitly added `-o %t.out` to prevent possible races. "bad" tests were discovered using `grep -rnP 'clangxx(?!.*\-o)' sycl/test/`
@@ -1,4 +1,4 @@ | |||
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s | FileCheck %s | |||
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s -o %t.out | FileCheck %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for reviewers: most of abi
tests started to fail with -fsyntax-only
because output from clang
was different. I haven't investigated it and simply decided to switch to -o %t.out
instead.
@@ -1,4 +1,4 @@ | |||
// RUN: %clangxx -fsycl -c %s | |||
// RUN: %clangxx -fsycl -fsyntax-only %s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for reviewers: -c
still creates an output file, which is a fat object file in case of -fsycl
compilation and that temporary file may still cause races. Therefore, I switched -c
tests to -fsyntax-only
: those tests do not check LLVM IR anyway and -fsyntax-only
doesn't create output files, which should make them a tiny bit faster (less I/O)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Can we also update some doc regarding writing the tests and put the following requirements to it? Can be done in the separate patch.
In addition to that we need an automated check that all tests comply with these requirements.
This seems to be a good starting point, but we need to allow |
Yes, I will prepare some "Testing guidelines" document
Yeah, that would be a good idea. I will try to come up with some script for that. |
Failure in unit-tests is a known flaky issue, which is being addressed in #7855 |
Hi folks, I've finally prepared a PR to follow-up on testing guidelines, see #8145 |
Use no output file instead of default output file in LIT tests. This occasionally caused errors on windows when multiple files compile to the same output file. Using `-fsyntax-only` hjere also avoids running the full compiler pipeline See #7872 for more context
Use no output file instead of default output file in LIT tests. This occasionally caused errors on windows when multiple files compile to the same output file. Using `-fsyntax-only` hjere also avoids running the full compiler pipeline See intel#7872 for more context
Use no output file instead of default output file in LIT tests. This occasionally caused errors on windows when multiple files compile to the same output file. Using `-fsyntax-only` hjere also avoids running the full compiler pipeline See intel#7872 for more context
This is a joined cherry-pick of #17367, #17362 and #17746 intended to fix a few remaining issues we see in 6.1 nightly validation run. Descriptions of cherry-picked commits: --- [SYCL] Disable launch_policy_neg.cpp on Windows (#17367) Fails to compile on new MSVC. Patch-by: Sarnie, Nick <nick.sarnie@intel.com> --- [SYCL] Avoid testing race condition Use no output file instead of default output file in LIT tests. This occasionally caused errors on windows when multiple files compile to the same output file. Using `-fsyntax-only` hjere also avoids running the full compiler pipeline See #7872 for more context Patch-By: David Garcia Orozco <david.garcia.orozco@intel.com> --- [SYCL] Fix clang-linker-wrapper Windows test (#17746) Failing now because I recently added `ptxas` to the path on these runners. Patch-by: Sarnie, Nick <nick.sarnie@intel.com> ---
This fixes sporadic issue with
check-sycl
on Windows. Apparently we had a number of tests, which didn't specify-o %t.out
and it caused some tests to write to the same defaulta.exe
and fail with error like:To resolve this, switch most of such tests to use
-fsyntax-only
or explicitly added-o %t.out
to prevent possible races."bad" tests were discovered using
grep -rnP 'clangxx(?!.*\-o)' sycl/test/