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

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 09:14:08 PDT 2024


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

This just requires additional REQUIRES support in lit for the built targets when running the test, the same as other built-backend dependent codegen tests. If you're actually updating the tests, you kind of need to have built all the targets

> We don't want the tests to fail if the user hasn't built certain targets,

Right, they should be skipped UNSUPPORTED.


> In that sense these are a little different to clang codegen tests - aren't they? clang can always compile for any of its supported targets. With libclc, however, the user is allowed to build only a handful of the targets, and each of those targets can have drastically different builtin implementations through specialization.

This is identical to clang codegen tests. Not every builtin emits identical IR, not every builtin is supported on every target, and some clang tests directly emit ISA and do have REQUIRES directives to only run if the backend built. It's something of an accident that clang can always emit target intrinsics without the corresponding backend being built (which in the past were stalled efforts to fix) 


Personally I think the build complexity of libclc having a parallel enabled target mechanism is not worth it, and should just be tied to the built backend support for the top level targets. It doesn't take all that long to build for the handful of triples

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


More information about the cfe-commits mailing list