1 // RUN: %offload-tblgen -gen-print-header -I %S/../../../liboffload/API %s | %fcheck-generic
3 // Check that ranged function parameters are implemented correctly. These
4 // are pointers to an array of an arbitrary size. Their size is described as a
5 // range between two values. This is typically between 0 and a parameter such
6 // as NumItems. The range information helps the printing code print the entire
7 // range of the output rather than just the pointer or the first element.
12 let name = "some_handle_t";
13 let desc = "An example handle type";
17 let name = "FunctionA";
18 let desc = "Function A description";
19 let details = [ "Function A detailed information" ];
21 Param<"size_t", "OutCount", "the number of things to write out", PARAM_IN>,
22 RangedParam<"some_handle_t*", "OutPtr", "pointer to the output things.", PARAM_OUT,
23 Range<"0", "OutCount">>
28 // CHECK: inline std::ostream &operator<<(std::ostream &os, const struct function_a_params_t *params) {
29 // CHECK: os << ".OutPtr = ";
30 // CHECK: for (size_t i = 0; i < *params->pOutCount; i++) {
31 // CHECK: if (i > 0) {
34 // CHECK: printPtr(os, (*params->pOutPtr)[i]);