Files
clang-p2996/offload/test/tools/offload-tblgen/entry_points.td
Ross Brunton 02d2a1646a [Offload] Fix entry_points.td test (#145292)
This was broken as part of #144494 , and just needs an update to the
check lines.
2025-06-23 11:09:08 +01:00

38 lines
1.2 KiB
TableGen

// RUN: %offload-tblgen -gen-entry-points -I %S/../../../liboffload/API %s | %fcheck-generic
// Check entry point wrapper functions are generated correctly
include "APIDefs.td"
def : Function {
let name = "FunctionA";
let desc = "Function A description";
let details = [ "Function A detailed information" ];
let params = [
Param<"uint32_t", "ParamA", "Parameter A description">,
Param<"uint32_t*", "ParamB", "Parameter B description">,
];
let returns = [
Return<"OL_ERRC_INVALID_VALUE", ["When a value is invalid"]>
];
}
// The validation function should call the implementation function
// CHECK: FunctionA_val
// CHECK: return llvm::offload::FunctionA_impl(ParamA, ParamB);
// CHECK: ol_result_t{{.*}} FunctionA(
// The entry point should print tracing output if enabled
// CHECK: if (llvm::offload::isTracingEnabled()) {
// CHECK-NEXT: "---> FunctionA";
// CHECK: Result = llvmErrorToOffloadError(FunctionA_val(ParamA, ParamB));
// Tracing should construct a param struct for printing
// CHECK: if (llvm::offload::isTracingEnabled()) {
// CHECK: function_a_params_t Params = {&ParamA, &ParamB};
// CHECK: return Result;