| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-fopenmp -fdump-tree-gimple" } */ |
| 3 |
|
| 4 |
struct bar |
| 5 |
{ |
| 6 |
int num_vectors; |
| 7 |
double *vectors; |
| 8 |
}; |
| 9 |
|
| 10 |
struct foo |
| 11 |
{ |
| 12 |
int num_vectors; |
| 13 |
struct bar *bars; |
| 14 |
double **vectors; |
| 15 |
}; |
| 16 |
|
| 17 |
void func (struct foo *f, int n, int m) |
| 18 |
{ |
| 19 |
#pragma omp target enter data map (to: f->vectors[m][:n]) |
| 20 |
#pragma omp target enter data map (to: f->bars[n].vectors[:m]) |
| 21 |
#pragma omp target enter data map (to: f->bars[n].vectors[:f->bars[n].num_vectors]) |
| 22 |
} |
| 23 |
|
| 24 |
/* { dg-final { scan-tree-dump-times {map\(struct:\*f \[len: 1\]\) map\(alloc:[a-z0-9\._]+->vectors \[len: 0\]\) map\(to:\*_[0-9]+ \[len: _[0-9]+\]\) map\(attach:[a-z0-9\._]+->vectors \[bias: [^\]]+\]\) map\(attach:\*_[0-9]+ \[bias: [^\]]+\]\)} 1 "gimple" } } */ |
| 25 |
/* { dg-final { scan-tree-dump-times {map\(struct:\*\(f->bars \+ \(sizetype\) \(\([^\)]+\) n \* (?:16|8)\)\) \[len: 1\]\) map\(alloc:[a-z0-9\._]+->vectors \[len: 0\]\) map\(to:\*_[0-9]+ \[len: _[0-9]+\]\) map\(attach:[a-z0-9\._]+->vectors \[bias: [^\]]+\]\)} 2 "gimple" } } */ |