aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/gomp/adjust-args-4.c
blob: 377932e1b9cc0e060f6ffb9e4ee891d2b1f60e8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* { dg-do compile } */
/* { dg-additional-options "-fdump-tree-gimple" } */

/* Ensure that adjust_args is only applied when variant substitution happens. */

void h(int *);
void f(int *);
#pragma omp declare variant(f) match(construct={dispatch}) adjust_args(need_device_ptr : x)
void g(int *x);

void foo(int *y)
{
  #pragma omp dispatch
    h(y);
  #pragma omp dispatch
    f(y);
  #pragma omp dispatch
    g(y);
}

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