blob: a47b5eb6df19630d95b14b5286692af09c052ebf (
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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
/* { dg-additional-options "-fdump-tree-original -fdump-tree-gimple" } */
void f()
{
struct s {
int i;
};
int scalar1 = 5;
int array1[5] = {1,2,3,4,5};
int *ptr1 = &scalar1;
struct s mystruct1 = {.i = 5};
/* firstprivate + unspecified modifer. */
#pragma omp target defaultmap(firstprivate)
{
scalar1 = 1;
array1[0] = 2;
if (ptr1 == 0L)
mystruct1.i = 3;
}
/* equivalent: firstprivate + ALL modifer. */
#pragma omp target defaultmap(firstprivate : all)
{
scalar1 = 1;
array1[0] = 2;
if (ptr1 == 0L)
mystruct1.i = 3;
}
/* tofrom + ALL modifer. */
#pragma omp target defaultmap(tofrom : all)
{
scalar1 = 1;
array1[0] = 2;
if (ptr1 == 0L)
mystruct1.i = 3;
}
}
/* { dg-final { scan-tree-dump-times "#pragma omp target defaultmap\\(firstprivate\\)" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "#pragma omp target defaultmap\\(firstprivate:all\\)" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "#pragma omp target defaultmap\\(tofrom:all\\)" 1 "original" } } */
/* { dg-final { scan-tree-dump-times "#pragma omp target.* defaultmap\\(firstprivate\\) firstprivate\\(mystruct1\\) firstprivate\\(ptr1\\) firstprivate\\(array1\\) firstprivate\\(scalar1\\)" 1 "gimple" } } */
/* { dg-final { scan-tree-dump-times "#pragma omp target.* defaultmap\\(firstprivate:all\\) firstprivate\\(mystruct1\\) firstprivate\\(ptr1\\) firstprivate\\(array1\\) firstprivate\\(scalar1\\)" 1 "gimple" } } */
/* { 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" } } */
|