| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-fopenmp" } */ |
| 3 |
|
| 4 |
#pragma omp declare target |
| 5 |
int a[] = { 1, 2, 3 }; |
| 6 |
extern int b[]; /* { dg-error "'b' in declare target directive does not have mappable type" } */ |
| 7 |
extern int c[]; /* { dg-error "'c' in declare target directive does not have mappable type" } */ |
| 8 |
extern int d[]; /* { dg-error "'d' in declare target directive does not have mappable type" } */ |
| 9 |
int d[3]; |
| 10 |
#pragma omp end declare target |
| 11 |
int c[3]; |
| 12 |
int e[] = { 1, 2, 3 }; |
| 13 |
#pragma omp declare target to (e) |
| 14 |
extern int f[]; |
| 15 |
#pragma omp declare target to (f) /* { dg-error "'f' does not have a mappable type in 'to' clause" } */ |
| 16 |
extern int g[]; |
| 17 |
#pragma omp declare target to (g) /* { dg-error "'g' does not have a mappable type in 'to' clause" } */ |
| 18 |
extern int g2[]; |
| 19 |
#pragma omp declare target enter (g2) /* { dg-error "'g2' does not have a mappable type in 'enter' clause" } */ |
| 20 |
int g[3]; |
| 21 |
extern int h[]; |
| 22 |
int h[3]; |
| 23 |
#pragma omp declare target to (h) |
| 24 |
#pragma omp declare target enter (h) |
| 25 |
|
| 26 |
int i[] = { 1, 2, 3 }; |
| 27 |
int j[] = { 1, 2, 3 }; |
| 28 |
extern int k[]; |
| 29 |
extern int l[]; |
| 30 |
extern int m[]; |
| 31 |
extern int n[]; |
| 32 |
extern int o[]; |
| 33 |
extern int p[]; |
| 34 |
int k[3]; |
| 35 |
int l[3]; |
| 36 |
int q; |
| 37 |
|
| 38 |
void |
| 39 |
foo (void) |
| 40 |
{ |
| 41 |
#pragma omp target update to (q) to (i) |
| 42 |
#pragma omp target map (tofrom: j) |
| 43 |
; |
| 44 |
#pragma omp target update from (q) from (k) |
| 45 |
#pragma omp target map (to: l) |
| 46 |
; |
| 47 |
#pragma omp target update from (q) from (m) /* { dg-error "'m' does not have a mappable type in 'from' clause" } */ |
| 48 |
#pragma omp target map (from: n) /* { dg-error "'n' does not have a mappable type in 'map' clause" } */ |
| 49 |
; |
| 50 |
#pragma omp target update to (q) to (o) /* { dg-error "'o' does not have a mappable type in 'to' clause" } */ |
| 51 |
#pragma omp target map (from: p) /* { dg-error "'p' does not have a mappable type in 'map' clause" } */ |
| 52 |
; |
| 53 |
} |
| 54 |
|
| 55 |
int o[3]; |
| 56 |
int p[3]; |