Skip to content

Commit 40d80c0

Browse files
[SYCL][NFC] Use unique (or no at all) output files in LIT tests (#7872)
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 parent 017bcdc commit 40d80c0

19 files changed

+30
-28
lines changed

sycl/test/abi/layout_accessors_host.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s | FileCheck %s
1+
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s -o %t.out | FileCheck %s
22
// REQUIRES: linux
33
// UNSUPPORTED: libcxx
44

sycl/test/abi/layout_array.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s | FileCheck %s
2-
// RUN: %clangxx -fsycl -fsycl-device-only -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s | FileCheck %s
1+
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s -o %t.out | FileCheck %s
2+
// RUN: %clangxx -fsycl -fsycl-device-only -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s -o %t.out | FileCheck %s
33
// REQUIRES: linux
44
// UNSUPPORTED: libcxx
55

sycl/test/abi/layout_buffer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s | FileCheck %s
1+
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s -o %t.out | FileCheck %s
22
// REQUIRES: linux
33
// UNSUPPORTED: libcxx
44

sycl/test/abi/layout_handler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s | FileCheck %s
1+
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s -o %t.out | FileCheck %s
22
// REQUIRES: linux
33
// UNSUPPORTED: libcxx
44

sycl/test/abi/layout_image.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s | FileCheck %s
1+
// RUN: %clangxx -fsycl -fsyntax-only -fno-color-diagnostics -Xclang -fdump-record-layouts %s | FileCheck %s
22
// REQUIRES: linux
33
// UNSUPPORTED: libcxx
44

sycl/test/abi/layout_vec.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s | FileCheck %s
2-
// RUN: %clangxx -fsycl -fsycl-device-only -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s | FileCheck %s
1+
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s -o %t.out | FileCheck %s
2+
// RUN: %clangxx -fsycl -fsycl-device-only -c -fno-color-diagnostics -Xclang -fdump-record-layouts %s -o %t.out | FileCheck %s
33
// REQUIRES: linux
44
// UNSUPPORTED: libcxx
55

sycl/test/abi/vtable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-vtable-layouts %s | FileCheck %s
1+
// RUN: %clangxx -fsycl -c -fno-color-diagnostics -Xclang -fdump-vtable-layouts %s -o %t.out | FileCheck %s
22
// REQUIRES: linux
33

44
#include <sycl/sycl.hpp>

sycl/test/basic_tests/accessor/iterator-member-types.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -c %s
1+
// RUN: %clangxx -fsycl -fsyntax-only %s
22
//
33
// Purpose of this test is to check that [accessor|host_accessor]::iterator and
44
// ::const_iterator are aliased to the correct type.

sycl/test/basic_tests/boost_mp11_import_sanity_check.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// http://www.boost.org/LICENSE_1_0.txt
1717
//===----------------------------------------------------------------------===//
1818

19-
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple -c %s
19+
// RUN: %clangxx -fsycl -fsyntax-only -fsycl-targets=%sycl_triple %s
2020

2121
// This is a sanity check test to verify that the automatic boost/mp11 import
2222
// into SYCL is not badly broken.

sycl/test/basic_tests/interop-backend-traits.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// RUN: %clangxx -fsycl -DUSE_OPENCL %s
2-
// RUN: %clangxx %fsycl-host-only -DUSE_L0 %s
3-
// RUN: %clangxx -fsycl -DUSE_CUDA %s
4-
// RUN: %clangxx -fsycl -DUSE_HIP %s
5-
// RUN: %clangxx -fsycl -DUSE_CUDA_EXPERIMENTAL %s
1+
// RUN: %clangxx -fsycl -fsyntax-only -DUSE_OPENCL %s
2+
// RUN: %clangxx %fsycl-host-only -fsyntax-only -DUSE_L0 %s
3+
// RUN: %clangxx -fsycl -fsyntax-only -DUSE_CUDA %s
4+
// RUN: %clangxx -fsycl -fsyntax-only -DUSE_HIP %s
5+
// RUN: %clangxx -fsycl -fsyntax-only -DUSE_CUDA_EXPERIMENTAL %s
66

77
#ifdef USE_OPENCL
88
#include <CL/cl.h>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clangxx -Wno-unused-command-line-argument -Werror -fsycl %s -c
1+
// RUN: %clangxx -Wno-unused-command-line-argument -Werror -fsycl -fsyntax-only %s
22

33
#include <iostream>
44
#include <sycl/sycl.hpp>
5-
void foo() { std::cout << 42; }
5+
void foo() { std::cout << 42; }
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
// RUN: %clangxx -Wno-unused-command-line-argument -Werror -fsycl %s -c
1+
// RUN: %clangxx -Wno-unused-command-line-argument -Werror -fsycl -fsyntax-only %s
22

33
// clang-format off
44
#include <sycl/sycl.hpp>
55
#include <iostream>
66
// clang-format on
7-
void foo() { std::cout << 42; }
7+
void foo() { std::cout << 42; }

sycl/test/basic_tests/relational_builtins.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clangxx -DSYCL2020_CONFORMANT_APIS -fsycl %s
2-
// RUN: %clangxx -sycl-std=121 -fsycl %s
1+
// RUN: %clangxx -DSYCL2020_CONFORMANT_APIS -fsycl -fsyntax-only %s
2+
// RUN: %clangxx -sycl-std=121 -fsycl -fsyntax-only %s
33

44
#include <CL/sycl.hpp>
55

sycl/test/basic_tests/span.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -c %s
1+
// RUN: %clangxx -fsycl -fsyntax-only %s
22

33
//==--------------- span.cpp - SYCL span test ------------------------------==//
44
//

sycl/test/gdb/accessors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -c -fno-color-diagnostics -std=c++17 -I %sycl_include/sycl -I %sycl_include -Xclang -ast-dump %s | FileCheck %s
1+
// RUN: %clangxx -fsyntax-only -fno-color-diagnostics -std=c++17 -I %sycl_include/sycl -I %sycl_include -Xclang -ast-dump %s | FileCheck %s
22
// RUN: %clangxx -c -fno-color-diagnostics -std=c++17 -I %sycl_include/sycl -I %sycl_include -Xclang -emit-llvm -g %s -o - | FileCheck %s --check-prefixes CHECK-DEBUG-INFO
33
// UNSUPPORTED: windows
44
#include <sycl/sycl.hpp>

sycl/test/gdb/printers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -c -fno-color-diagnostics -std=c++17 -I %sycl_include/sycl -I %sycl_include -Xclang -ast-dump %s | FileCheck %s
1+
// RUN: %clangxx -fsyntax-only -fno-color-diagnostics -std=c++17 -I %sycl_include/sycl -I %sycl_include -Xclang -ast-dump %s | FileCheck %s
22
// UNSUPPORTED: windows
33
#include <sycl/buffer.hpp>
44
#include <sycl/detail/array.hpp>

sycl/test/gdb/private-memory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -c -fsycl -fno-color-diagnostics -Xclang -ast-dump %s | FileCheck %s
1+
// RUN: %clangxx -fsyntax-only -fsycl -fno-color-diagnostics -Xclang -ast-dump %s | FileCheck %s
22
// UNSUPPORTED: windows
33
#include <sycl/group.hpp>
44
#include <sycl/id.hpp>

sycl/test/invoke_simd/invoke_simd.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// RUN: %clangxx -c -fsycl -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr %s
1+
// RUN: %clangxx -fsycl -fsyntax-only -fno-sycl-device-code-split-esimd -Xclang -fsycl-allow-func-ptr %s
2+
// FIXME: check if -fno-sycl-device-code-split-esimd affects any pre-link steps
3+
// and remove the flag if that is not the case
24

35
// The tests checks that invoke_simd API is compileable.
46

sycl/test/regression/print_args.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl %s -c
1+
// RUN: %clangxx -fsycl -fsyntax-only %s
22

33
// Regression tests for https://github.com/intel/llvm/issues/1011
44
// Checks that SYCL headers call internal templated function 'printArgs'

0 commit comments

Comments
 (0)