[llvm] [libsycl] Add lit configuration files and basic test (PR #177407)

Kseniya Tikhomirova via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 9 06:37:05 PST 2026


================
@@ -0,0 +1,85 @@
+## Getting Started
+
+This directory contains `libsycl` tests distributed in subdirectories based on
+testing scope. `libsycl` uses LIT to configure and run its tests.
+
+Please see the [Lit Command Guide](https://llvm.org/docs/CommandGuide/lit.html)
+for more information about LIT.
+
+## Prerequisites
+
+* Target runtime(s) to execute tests on devices.
+  TODO: add link to liboffload instruction once they add it.
+* Compiler & libsycl. Can be built following these
+  [instructions](/libsycl/docs/index.rst).
+
+## Run the tests
+
+`libsycl` is integrated via LLVM_ENABLE_RUNTIMES and is not visible as top
+level target. Same is applicable for tests. To run `check-sycl` tests you
+need to prefix `<build>/runtimes/runtimes-bins/` to the paths of all tests.
+For example, to run all the libsycl tests you can do:
+```bash
+<build>/bin/llvm-lit <build>/runtimes/runtimes-bins/libsycl/test
+```
+
+To run individual test, use the path to it instead.
+
+If you are using `ninja` as your build system, you can run all the tests in the
+libsycl testsuite as:
+
+```bash
+ ninja -C <build>/runtimes/runtimes-bins check-sycl
+ ```
+
+
+## CMake parameters
+
+These parameters can be used to configure tests:
+
+`LIBSYCL_CXX_COMPILER` - path to compiler to use it for building tests.
+
+`LIBSYCL_TEST_CXX_FLAGS` - flags to be passed to `LIBSYCL_CXX_COMPILER` when
+    building libsycl tests.
+
+`LLVM_LIT` - path to llvm-lit tool.
+
+## Creating or modifying tests
+
+### LIT feature checks
+
+Following features can be passed to LIT via `REQUIRES`, `UNSUPPORTED`, etc.
+filters to limit test execution to the specific environment.
+
+#### Auto-detected features
+
+The following features are automatically detected by `llvm-lit` by scanning the
+environment:
+
+* `linux` - host OS;
----------------
KseniyaTikhomirova wrote:

https://github.com/llvm/llvm-project/pull/177407/commits/b4ff90c5c72ed97d3aa4eccc3e554f8d23f8f4c0

https://github.com/llvm/llvm-project/pull/177407


More information about the llvm-commits mailing list