aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/dispatch-4.c
blob: d905cbc83f0430209e966d68807ddafe76c24b3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* { dg-do compile } */
/* { dg-additional-options "-std=gnu17" } */
/* { dg-additional-options "-fdump-tree-gimple" } */

/* Check that when the variant has an empty parameter list, the host-to-device 
   pointer conversion still happens.  */

void variant_fn();  // Assume C < C23; in C++/C23 it becomes the same as '…(void)'.

#pragma omp declare variant(variant_fn) match(construct={dispatch}) adjust_args(need_device_ptr: x,y)
void bar(int *x, int *y);

void sub(int *x, int *y)
{
  #pragma omp dispatch is_device_ptr(y)
     bar(x, y);
}

/* { dg-final { scan-tree-dump-times "D\\.\[0-9\]+ = __builtin_omp_get_mapped_ptr \\(x, D\\.\[0-9\]+\\);" 1 "gimple" } } */