Debian Codegraph @

gcc/testsuite/c-c++-common/gomp/defaultmap-5.c

raw
1 /* { dg-additional-options "-fdump-tree-original -fdump-tree-gimple" } */
2
3 void f()
4 {
5 struct s {
6 int i;
7 };
8 int scalar1 = 5;
9 int array1[5] = {1,2,3,4,5};
10 int *ptr1 = &scalar1;
11 struct s mystruct1 = {.i = 5};
12
13 /* firstprivate + unspecified modifer. */
14 #pragma omp target defaultmap(firstprivate)
15 {
16 scalar1 = 1;
17 array1[0] = 2;
18 if (ptr1 == 0L)
19 mystruct1.i = 3;
20 }
21
22 /* equivalent: firstprivate + ALL modifer. */
23 #pragma omp target defaultmap(firstprivate : all)
24 {
25 scalar1 = 1;
26 array1[0] = 2;
27 if (ptr1 == 0L)
28 mystruct1.i = 3;
29 }
30
31 /* tofrom + ALL modifer. */
32 #pragma omp target defaultmap(tofrom : all)
33 {
34 scalar1 = 1;
35 array1[0] = 2;
36 if (ptr1 == 0L)
37 mystruct1.i = 3;
38 }
39 }
40
41 /* { dg-final { scan-tree-dump-times "#pragma omp target defaultmap\\(firstprivate\\)" 1 "original" } } */
42 /* { dg-final { scan-tree-dump-times "#pragma omp target defaultmap\\(firstprivate:all\\)" 1 "original" } } */
43 /* { dg-final { scan-tree-dump-times "#pragma omp target defaultmap\\(tofrom:all\\)" 1 "original" } } */
44
45 /* { dg-final { scan-tree-dump-times "#pragma omp target.* defaultmap\\(firstprivate\\) firstprivate\\(mystruct1\\) firstprivate\\(ptr1\\) firstprivate\\(array1\\) firstprivate\\(scalar1\\)" 1 "gimple" } } */
46 /* { dg-final { scan-tree-dump-times "#pragma omp target.* defaultmap\\(firstprivate:all\\) firstprivate\\(mystruct1\\) firstprivate\\(ptr1\\) firstprivate\\(array1\\) firstprivate\\(scalar1\\)" 1 "gimple" } } */
47 /* { dg-final { scan-tree-dump-times "#pragma omp target.* defaultmap\\(tofrom:all\\) map\\(tofrom:mystruct1 \\\[len: .\\\] \\\[runtime_implicit\\\]\\) map\\(tofrom:ptr1 \\\[len: .\\\] \\\[runtime_implicit\\\]\\) map\\(tofrom:array1 \\\[len: ..\\\] \\\[runtime_implicit\\\]\\) map\\(tofrom:scalar1 \\\[len: .\\\] \\\[runtime_implicit\\\]\\)" 1 "gimple" } } */