Skip to content

[SYCL][E2E] Add RUN-IF lit keyword#21288

Merged
sarnex merged 1 commit intointel:syclfrom
sarnex:runif
Feb 18, 2026
Merged

[SYCL][E2E] Add RUN-IF lit keyword#21288
sarnex merged 1 commit intointel:syclfrom
sarnex:runif

Conversation

@sarnex
Copy link
Contributor

@sarnex sarnex commented Feb 13, 2026

Add a new LIT keyword, RUN-IF, to simplify conditional commands in LIT tests.

This is useful for when you have a single test but need to do different things depending on the environment.

You can arleady to this today, but the syntax is verbose, something like RUN: %if condition %{ case %} %else %{ another_case %}

We are planning to use the immediately in interop tests.

I modified some exists tests using the verbose syntax to lock down this new syntax.

// RUN: %if any-device-is-cpu && opencl-aot %{ %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s %}
// RUN: %if cpu && opencl-aot %{ %{run} %t.x86.out %}
// RUN-IF: any-device-is-cpu && opencl-aot, %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s
// RUN-IF: cpu, %{run} %t.x86.out
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed opencl-aot from the conditional in all the run lines, it's not related to this feature, opencl-aot is a build only feature so it's always false in run mode, so even today this condition never runs

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
@sarnex
Copy link
Contributor Author

sarnex commented Feb 17, 2026

Also ignoring the code format CI fail because it's wrong.

Copy link
Contributor

@uditagarwal97 uditagarwal97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good idea to me.

@sarnex sarnex merged commit d258182 into intel:sycl Feb 18, 2026
72 of 78 checks passed
@sarnex
Copy link
Contributor Author

sarnex commented Feb 18, 2026

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants