| 1 |
// { dg-do compile } |
| 2 |
// { dg-options "-fopenmp -fdump-tree-gimple" } |
| 3 |
|
| 4 |
struct S |
| 5 |
{ |
| 6 |
int a, b; |
| 7 |
void bar (int); |
| 8 |
}; |
| 9 |
|
| 10 |
void |
| 11 |
S::bar (int x) |
| 12 |
{ |
| 13 |
#pragma omp target map (alloc: a, b) |
| 14 |
; |
| 15 |
#pragma omp target enter data map (alloc: a, b) |
| 16 |
} |
| 17 |
|
| 18 |
template <int N> |
| 19 |
struct T |
| 20 |
{ |
| 21 |
int a, b; |
| 22 |
void bar (int); |
| 23 |
}; |
| 24 |
|
| 25 |
template <int N> |
| 26 |
void |
| 27 |
T<N>::bar (int x) |
| 28 |
{ |
| 29 |
#pragma omp target map (alloc: a, b) |
| 30 |
; |
| 31 |
#pragma omp target enter data map (alloc: a, b) |
| 32 |
} |
| 33 |
|
| 34 |
template struct T<0>; |
| 35 |
|
| 36 |
/* { dg-final { scan-tree-dump-times "map\\(struct:\\*\\(struct S \\*\\) this \\\[len: 2\\\]\\) map\\(alloc:this->a \\\[len: \[0-9\]+\\\]\\) map\\(alloc:this->b \\\[len: \[0-9\]+\\\]\\)" 2 "gimple" } } */ |
| 37 |
|
| 38 |
/* { dg-final { scan-tree-dump-times "map\\(struct:\\*\\(struct T \\*\\) this \\\[len: 2\\\]\\) map\\(alloc:this->a \\\[len: \[0-9\]+\\\]\\) map\\(alloc:this->b \\\[len: \[0-9\]+\\\]\\)" 2 "gimple" } } */ |