Skip to content

Commit 7f24cac

Browse files
[SYCL][NFC] Use -fsyntax-only more extensively in LIT tests (#8144)
Adjusted LIT tests to use syntax-only mode for some tests which perform full compilation and linking or only compilation (`-c`) to speed up those tests. Also removed `-o` option from some existing `-fsyntax-only` mode to shorten `RUN` lines, because it is anyway ignored by the compiler. Refactored some tests for predefined macro to make checks at compile-time and not at runtime.
1 parent 2b1d320 commit 7f24cac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+98
-93
lines changed

sycl/test/basic_tests/accessor/accessor_property_list_ct.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
1+
// RUN: %clangxx -fsycl -fsyntax-only %s
22

33
#include <sycl/sycl.hpp>
44

sycl/test/basic_tests/accessor/addrspace_exposure.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
1+
// RUN: %clangxx -fsycl -fsyntax-only %s
22
//==------- addrspace_exposure.cpp - SYCL accessor AS exposure test --------==//
33
//
44
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

sycl/test/basic_tests/accessor/atomic_zero_dimension_accessor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clangxx -fsycl -fsyntax-only %s -o %t.out
2-
// RUN: %clangxx -fsycl -fsyntax-only -fsycl-targets=spir64_fpga %s -o %t.out
1+
// RUN: %clangxx -fsycl -fsyntax-only %s
2+
// RUN: %clangxx -fsycl -fsyntax-only -fsycl-targets=spir64_fpga %s
33

44
// When using zero dimension accessors with atomic access we
55
// want to make sure they are compiling correctly on all devices,
@@ -63,4 +63,4 @@ int main(int argc, char *argv[]) {
6363
std::cout << std::endl;
6464

6565
return 0;
66-
}
66+
}

sycl/test/basic_tests/atomic-ref-instantiation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s -o %t.out -Xclang -verify-ignore-unexpected=note
1+
// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s -Xclang -verify-ignore-unexpected=note
22
// expected-no-diagnostics
33
#include <sycl/atomic_ref.hpp>
44

sycl/test/basic_tests/cl_sycl_hpp.cpp

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

33
#include <CL/sycl.hpp>
44

sycl/test/basic_tests/define_vendors.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -c -o %t.out
1+
// RUN: %clangxx -fsycl -fsyntax-only %s
22
#include <sycl/sycl.hpp>
33

44
#if !defined(SYCL_IMPLEMENTATION_ONEAPI)

sycl/test/basic_tests/generic_type_traits.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
1+
// RUN: %clangxx -fsycl -fsyntax-only %s
22

33
#include <cassert>
44
#include <iostream>

sycl/test/basic_tests/interop-cuda.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// REQUIRES: cuda
2-
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out
3-
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note -D__SYCL_INTERNAL_API %s -o %t.out
2+
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s
3+
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note -D__SYCL_INTERNAL_API %s
44
//
55
/// Also test the experimental CUDA interop interface
6-
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note -DSYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL %s -o %t.out
7-
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note -D__SYCL_INTERNAL_API -DSYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL %s -o %t.out
6+
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note -DSYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL %s
7+
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note -D__SYCL_INTERNAL_API -DSYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL %s
88
// expected-no-diagnostics
99

1010
// Test for legacy and experimental CUDA interop API

sycl/test/basic_tests/interop-hip.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: hip_be
2-
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out
3-
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note -D__SYCL_INTERNAL_API %s -o %t.out
2+
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s
3+
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note -D__SYCL_INTERNAL_API %s
44
// expected-no-diagnostics
55

66
// Test for HIP interop API

sycl/test/basic_tests/interop-level-zero-2020.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s -o %t.out
2-
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note -D__SYCL_INTERNAL_API %s -o %t.out
1+
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s
2+
// RUN: %clangxx %fsycl-host-only -fsyntax-only -Xclang -verify -Xclang -verify-ignore-unexpected=note -D__SYCL_INTERNAL_API %s
33

44
// Test for SYCL-2020 Level Zero interop API
55

0 commit comments

Comments
 (0)