brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 94ea820 Raw
37 lines · plain
1// RUN: %offload-tblgen -gen-entry-points -I %S/../../../liboffload/API %s | %fcheck-generic2 3// Check entry point wrapper functions are generated correctly4 5include "APIDefs.td"6 7def FunctionA : Function {8    let desc = "Function A description";9    let details = [ "Function A detailed information" ];10    let params = [11        Param<"uint32_t", "ParamA", "Parameter A description">,12        Param<"uint32_t*", "ParamB", "Parameter B description">,13    ];14    let returns = [15        Return<"OL_ERRC_INVALID_VALUE", ["When a value is invalid"]>16    ];17}18 19 20// The validation function should call the implementation function21// CHECK: FunctionA_val22// CHECK: return llvm::offload::FunctionA_impl(ParamA, ParamB);23 24// CHECK: ol_result_t{{.*}} FunctionA(25 26// The entry point should print tracing output if enabled27// CHECK: if (llvm::offload::isTracingEnabled()) {28// CHECK-NEXT: "---> FunctionA";29 30// CHECK: Result = llvmErrorToOffloadError(FunctionA_val(ParamA, ParamB));31 32// Tracing should construct a param struct for printing33// CHECK: if (llvm::offload::isTracingEnabled()) {34// CHECK: function_a_params_t Params = {&ParamA, &ParamB};35 36// CHECK: return Result;37