| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-std=gnu17" } */ |
| 3 |
/* { dg-additional-options "-fdump-tree-gimple" } */ |
| 4 |
|
| 5 |
/* Check that when the variant has an empty parameter list, the host-to-device |
| 6 |
pointer conversion still happens. */ |
| 7 |
|
| 8 |
void variant_fn(); // Assume C < C23; in C++/C23 it becomes the same as '…(void)'. |
| 9 |
|
| 10 |
#pragma omp declare variant(variant_fn) match(construct={dispatch}) adjust_args(need_device_ptr: x,y) |
| 11 |
void bar(int *x, int *y); |
| 12 |
|
| 13 |
void sub(int *x, int *y) |
| 14 |
{ |
| 15 |
#pragma omp dispatch is_device_ptr(y) |
| 16 |
bar(x, y); |
| 17 |
} |
| 18 |
|
| 19 |
/* { dg-final { scan-tree-dump-times "D\\.\[0-9\]+ = __builtin_omp_get_mapped_ptr \\(x, D\\.\[0-9\]+\\);" 1 "gimple" } } */ |