Skip to content

Commit d76ffef

Browse files
committed
Apply suggestions
1. restore modified tests 2. use llvm-lit instead of grep 3. update a set of available features to match everything from lit.cfg.py
1 parent 239a975 commit d76ffef

File tree

8 files changed

+36
-31
lines changed

8 files changed

+36
-31
lines changed

sycl/test-e2e/Basic/fpga_tests/fpga_aocx_win.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// REQUIRES: opencl-aot, accelerator, windows
9+
// REQUIRES: opencl-aot, accelerator
10+
// REQUIRES: system-windows
1011

1112
/// E2E test for AOCX creation/use/run for FPGA
1213
// Produce an archive with device (AOCX) image. To avoid appending objects to

sycl/test-e2e/Plugin/sycl-ls-gpu-default-level-zero.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: gpu, level_zero
1+
// REQUIRES: gpu, level-zero
22

33
// TODO: Remove unsetting SYCL_DEVICE_FILTER when feature is dropped
44
// RUN: env --unset=SYCL_DEVICE_FILTER --unset=ONEAPI_DEVICE_SELECTOR sycl-ls --verbose >%t.default.out

sycl/test-e2e/Regression/msvc_crt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: %{run} %t1.exe
33
// RUN: %{build} /MDd -o %t2.exe
44
// RUN: %{run} %t2.exe
5-
// REQUIRES: windows, cl_options
5+
// REQUIRES: system-windows, cl_options
66
//==-------------- msvc_crt.cpp - SYCL MSVC CRT test -----------------------==//
77
//
88
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

sycl/test-e2e/SpecConstants/2020/native_specialization_constant.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// (because only SPIR-V supports specialization constants natively)
44

55
// FIXME: This set is never satisfied all at once in our infrastructure.
6-
// REQUIRES: opencl, level_zero, cpu, gpu, opencl-aot, ocloc
6+
// REQUIRES: opencl, level-zero, cpu, gpu, opencl-aot, ocloc
77

88
// RUN: %clangxx -fsycl -DJIT %s -o %t.out
99
// RUN: %{run} %t.out
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// This test checks that all "REQUIRES", "XFAIL" and "UNSUPPORTED" strings
2+
// contain the right feature names.
3+
// If this test fails:
4+
// 1. there is some typo/non-existing feature request in the
5+
// modified test.
6+
// 2. ...or, there is some new feature. In this case please update the set of
7+
// features in check-correctness-of-requirements.py
8+
//
9+
// Get a set of all features passed to "REQUIRES", "XFAIL" and "UNSUPPORTED"
10+
// RUN: llvm-lit --show-used-features %S/../../test-e2e > %t
11+
//
12+
// Process this set using a python script as it's easier to work with sets there
13+
// RUN: python3 %S/check-correctness-of-requirements.py %t %sycl_include

sycl/test/e2e_test_requirements/check-correctness-of-requires.py renamed to sycl/test/e2e_test_requirements/check-correctness-of-requirements.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# See check-correctness-of-requires.cpp
1+
# See check-correctness-of-requirements.cpp
22

33
import re
44
import sys
@@ -19,18 +19,22 @@ def parse_requirements(input_data_path, sycl_include_dir_path):
1919
available_features = {
2020
# host OS:
2121
"windows",
22+
"system-windows",
2223
"linux",
24+
"system-linux",
2325
# target device:
2426
"cpu",
2527
"gpu",
2628
"accelerator",
2729
# target backend:
2830
"cuda",
2931
"hip",
32+
"hip_amd",
33+
"hip_nvidia",
3034
"opencl",
3135
"level_zero",
36+
"level-zero",
3237
"native_cpu",
33-
"hip_amd",
3438
# tools:
3539
"sycl-ls",
3640
"cm-compiler",
@@ -49,6 +53,8 @@ def parse_requirements(input_data_path, sycl_include_dir_path):
4953
"gpu-intel-dg2",
5054
"gpu-intel-pvc",
5155
"gpu-intel-pvc-vg",
56+
"gpu-intel-pvc-1T",
57+
"gpu-intel-pvc-2T",
5258
"gpu-amd-gfx90a",
5359
# any-device-is-:
5460
"any-device-is-cpu",
@@ -58,6 +64,7 @@ def parse_requirements(input_data_path, sycl_include_dir_path):
5864
"any-device-is-hip",
5965
"any-device-is-opencl",
6066
"any-device-is-level_zero",
67+
"any-device-is-native_cpu",
6168
# sg-sizes (should we allow any sg-X?)
6269
"sg-8",
6370
"sg-16",
@@ -71,6 +78,9 @@ def parse_requirements(input_data_path, sycl_include_dir_path):
7178
"zstd",
7279
"preview-breaking-changes-supported",
7380
"vulkan",
81+
"O0",
82+
"ze_debug",
83+
"igc-dev",
7484
# Note: aspects and architectures are gathered below
7585
}
7686

@@ -96,20 +106,11 @@ def parse_requirements(input_data_path, sycl_include_dir_path):
96106

97107
exit_code = 0
98108
with open(input_data_path, "r") as file:
99-
for line in file:
100-
# get the content of "REQUIRES: "
101-
requirements = re.compile(r"// REQUIRES: (.*)").search(line)
102-
# Drop all symbols except feature names
103-
requirements = re.split(r"&&|\|\||, |,|\(|\)|\s+", requirements.group(1))
104-
# Filter out empty names
105-
requirements = [req.strip() for req in requirements if req.strip()]
106-
107-
for feature in requirements:
108-
# some names can start with "!" e.g. "!level_zero", drop "!"
109-
feature = feature.lstrip("!")
110-
if not feature in available_features:
111-
exit_code = 1
112-
print(line + "contains unsupported feature: " + feature)
109+
requirements = set(file.read().split())
110+
for requirement in requirements:
111+
if not requirement in available_features:
112+
exit_code = 1
113+
print("Unsupported requirement: " + requirement)
113114
sys.exit(exit_code)
114115

115116

sycl/test/e2e_test_requirements/check-correctness-of-requires.cpp

Lines changed: 0 additions & 10 deletions
This file was deleted.

sycl/test/regression/sycl-include-gnu17.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %clangxx -std=gnu++17 -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
22
// RUN: %t.out
33

4-
// UNSUPPORTED: windows
4+
// UNSUPPORTED: system-windows
55

66
#include <iostream>
77
#include <sycl/sycl.hpp>

0 commit comments

Comments
 (0)