Debian Codegraph @

gcc/testsuite/c-c++-common/gomp/adjust-args-4.c

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-fdump-tree-gimple" } */
3
4 /* Ensure that adjust_args is only applied when variant substitution happens. */
5
6 void h(int *);
7 void f(int *);
8 #pragma omp declare variant(f) match(construct={dispatch}) adjust_args(need_device_ptr : x)
9 void g(int *x);
10
11 void foo(int *y)
12 {
13 #pragma omp dispatch
14 h(y);
15 #pragma omp dispatch
16 f(y);
17 #pragma omp dispatch
18 g(y);
19 }
20
21 /* { dg-final { scan-tree-dump-times "h \\(y\\);" 1 "gimple" } } */
22 /* { dg-final { scan-tree-dump-times "f \\(y\\);" 1 "gimple" } } */
23 /* { dg-final { scan-tree-dump-times "D\.\[0-9]+ = __builtin_omp_get_mapped_ptr \\(y, D\.\[0-9]+\\);" 1 "gimple" } } */
24 /* { dg-final { scan-tree-dump-times "f \\(D\.\[0-9]+\\);" 1 "gimple" } } */