[libclc] [libclc] Add initial LIT tests (PR #87989)

Fraser Cormack via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 04:22:55 PDT 2024


================
@@ -1,3 +1,6 @@
-__kernel void foo(int *i) {
+// RUN: %clang -emit-llvm -S -o - %s | FileCheck %s
----------------
frasercrmck wrote:

Yes, I was hoping to explore in that direction. I've kind of just copied the skeleton of the LIT tests we have downstream, but as you say, this isn't really workable as it assumes all tests will be able to use the same CHECK.

I think, for this to work, we'd have to configure LIT with all of the `libclc` targets (or, a subset we're interested in), then `RUN` each test multiple times with a unique `FileCheck` check prefix for each target. Then when running `update_cc_test_checks` it'd run the test on all targets.

I think we'd need a macro or substitution to expand a single `RUN` line to multiple architectures, to keep things maintainable.

We could also allow running the tests on just the one or a subset of architectures locally, using a `--param` to control the architectures to test.

Does that sound like a good direction? to take this in?

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


More information about the cfe-commits mailing list