38 lines
1.2 KiB
TableGen
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;
|