Debian Codegraph @

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

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-fdump-tree-gimple" } */
3
4 int f (int a, void *b, float c[2]);
5
6 #pragma omp declare variant (f) match (construct={dispatch}) adjust_args (nothing: a) adjust_args (need_device_ptr: b, c)
7 int f0 (int a, void *b, float c[2]);
8 #pragma omp declare variant (f) match (construct={dispatch}) adjust_args (nothing: a) adjust_args (need_device_ptr: b) adjust_args (need_device_ptr: c)
9 int f1 (int a, void *b, float c[2]);
10
11 int test () {
12 int a;
13 void *b;
14 float c[2];
15 struct {int a;} s;
16
17 s.a = f0 (a, b, c);
18 #pragma omp dispatch
19 s.a = f0 (a, b, c);
20
21 f1 (a, b, c);
22 #pragma omp dispatch
23 s.a = f1 (a, b, c);
24
25 return s.a;
26 }
27
28 /* { dg-final { scan-tree-dump-times "__builtin_omp_get_default_device \\(\\);" 2 "gimple" } } */
29 /* { dg-final { scan-tree-dump-times "D\.\[0-9]+ = __builtin_omp_get_mapped_ptr \\(&c, D\.\[0-9]+\\);" 2 "gimple" } } */
30 /* { dg-final { scan-tree-dump-times "D\.\[0-9]+ = __builtin_omp_get_mapped_ptr \\(b, D\.\[0-9]+\\);" 2 "gimple" } } */