| 1 |
int x; |
| 2 |
extern int z; |
| 3 |
|
| 4 |
void |
| 5 |
foo (void) |
| 6 |
{ |
| 7 |
int y = 0, i; |
| 8 |
static int w; |
| 9 |
#pragma omp task default(firstprivate) /* { dg-message "note: enclosing 'task'" } */ |
| 10 |
{ |
| 11 |
y++; /* { dg-bogus "'y' not specified in enclosing 'task'" } */ |
| 12 |
w++; /* { dg-bogus "'w' not specified in enclosing 'task'" } */ |
| 13 |
x++; /* { dg-error "'x' not specified in enclosing 'task'" } */ |
| 14 |
z++; /* { dg-error "'z' not specified in enclosing 'task'" } */ |
| 15 |
} |
| 16 |
#pragma omp taskloop default(firstprivate) /* { dg-message "note: enclosing 'taskloop'" } */ |
| 17 |
for (i = 0; i < 64; i++) |
| 18 |
{ |
| 19 |
y++; /* { dg-bogus "'y' not specified in enclosing 'taskloop'" } */ |
| 20 |
w++; /* { dg-bogus "'w' not specified in enclosing 'taskloop'" } */ |
| 21 |
x++; /* { dg-error "'x' not specified in enclosing 'taskloop'" } */ |
| 22 |
z++; /* { dg-error "'z' not specified in enclosing 'taskloop'" } */ |
| 23 |
} |
| 24 |
#pragma omp teams default(firstprivate) /* { dg-message "note: enclosing 'teams'" } */ |
| 25 |
{ |
| 26 |
y++; /* { dg-bogus "'y' not specified in enclosing 'teams'" } */ |
| 27 |
w++; /* { dg-bogus "'w' not specified in enclosing 'teams'" } */ |
| 28 |
x++; /* { dg-error "'x' not specified in enclosing 'teams'" } */ |
| 29 |
z++; /* { dg-error "'z' not specified in enclosing 'teams'" } */ |
| 30 |
} |
| 31 |
#pragma omp parallel default(firstprivate) /* { dg-message "note: enclosing 'parallel'" } */ |
| 32 |
{ |
| 33 |
y++; /* { dg-bogus "'y' not specified in enclosing 'parallel'" } */ |
| 34 |
w++; /* { dg-bogus "'w' not specified in enclosing 'parallel'" } */ |
| 35 |
x++; /* { dg-error "'x' not specified in enclosing 'parallel'" } */ |
| 36 |
z++; /* { dg-error "'z' not specified in enclosing 'parallel'" } */ |
| 37 |
} |
| 38 |
#pragma omp task default(private) /* { dg-message "note: enclosing 'task'" } */ |
| 39 |
{ |
| 40 |
y = 1; /* { dg-bogus "'y' not specified in enclosing 'task'" } */ |
| 41 |
w = 1; /* { dg-bogus "'w' not specified in enclosing 'task'" } */ |
| 42 |
x++; /* { dg-error "'x' not specified in enclosing 'task'" } */ |
| 43 |
z++; /* { dg-error "'z' not specified in enclosing 'task'" } */ |
| 44 |
} |
| 45 |
#pragma omp taskloop default(private) /* { dg-message "note: enclosing 'taskloop'" } */ |
| 46 |
for (i = 0; i < 64; i++) |
| 47 |
{ |
| 48 |
y = 1; /* { dg-bogus "'y' not specified in enclosing 'taskloop'" } */ |
| 49 |
w = 1; /* { dg-bogus "'w' not specified in enclosing 'taskloop'" } */ |
| 50 |
x++; /* { dg-error "'x' not specified in enclosing 'taskloop'" } */ |
| 51 |
z++; /* { dg-error "'z' not specified in enclosing 'taskloop'" } */ |
| 52 |
} |
| 53 |
#pragma omp teams default(private) /* { dg-message "note: enclosing 'teams'" } */ |
| 54 |
{ |
| 55 |
y = 1; /* { dg-bogus "'y' not specified in enclosing 'teams'" } */ |
| 56 |
w = 1; /* { dg-bogus "'w' not specified in enclosing 'teams'" } */ |
| 57 |
x++; /* { dg-error "'x' not specified in enclosing 'teams'" } */ |
| 58 |
z++; /* { dg-error "'z' not specified in enclosing 'teams'" } */ |
| 59 |
} |
| 60 |
#pragma omp parallel default(private) /* { dg-message "note: enclosing 'parallel'" } */ |
| 61 |
{ |
| 62 |
y = 1; /* { dg-bogus "'y' not specified in enclosing 'parallel'" } */ |
| 63 |
w++; /* { dg-bogus "'w' not specified in enclosing 'parallel'" } */ |
| 64 |
x++; /* { dg-error "'x' not specified in enclosing 'parallel'" } */ |
| 65 |
z++; /* { dg-error "'z' not specified in enclosing 'parallel'" } */ |
| 66 |
} |
| 67 |
} |