| 1 |
namespace N |
| 2 |
{ |
| 3 |
int x; |
| 4 |
extern int z; |
| 5 |
} |
| 6 |
|
| 7 |
struct S |
| 8 |
{ |
| 9 |
static int s; |
| 10 |
}; |
| 11 |
|
| 12 |
#if __cpp_variable_templates >= 201304 |
| 13 |
template <int N> |
| 14 |
int t = N; |
| 15 |
#endif |
| 16 |
|
| 17 |
void |
| 18 |
foo (void) |
| 19 |
{ |
| 20 |
int y = 0, i; |
| 21 |
static int w; |
| 22 |
#pragma omp task default(firstprivate) /* { dg-message "note: enclosing 'task'" } */ |
| 23 |
{ |
| 24 |
y++; /* { dg-bogus "'y' not specified in enclosing 'task'" } */ |
| 25 |
w++; /* { dg-bogus "'w' not specified in enclosing 'task'" } */ |
| 26 |
S::s++; /* { dg-bogus "'S::s' not specified in enclosing 'task'" } */ |
| 27 |
N::x++; /* { dg-error "'x' not specified in enclosing 'task'" } */ |
| 28 |
N::z++; /* { dg-error "'z' not specified in enclosing 'task'" } */ |
| 29 |
#if __cpp_variable_templates >= 201304 |
| 30 |
t<5>++; /* { dg-error "'t' not specified in enclosing 'task'" "" { target c++14 } } */ |
| 31 |
#endif |
| 32 |
} |
| 33 |
#pragma omp taskloop default(firstprivate) /* { dg-message "note: enclosing 'taskloop'" } */ |
| 34 |
for (i = 0; i < 64; i++) |
| 35 |
{ |
| 36 |
y++; /* { dg-bogus "'y' not specified in enclosing 'taskloop'" } */ |
| 37 |
w++; /* { dg-bogus "'w' not specified in enclosing 'taskloop'" } */ |
| 38 |
S::s++; /* { dg-bogus "'S::s' not specified in enclosing 'taskloop'" } */ |
| 39 |
N::x++; /* { dg-error "'x' not specified in enclosing 'taskloop'" } */ |
| 40 |
N::z++; /* { dg-error "'z' not specified in enclosing 'taskloop'" } */ |
| 41 |
#if __cpp_variable_templates >= 201304 |
| 42 |
t<5>++; /* { dg-error "'t' not specified in enclosing 'taskloop'" "" { target c++14 } } */ |
| 43 |
#endif |
| 44 |
} |
| 45 |
#pragma omp teams default(firstprivate) /* { dg-message "note: enclosing 'teams'" } */ |
| 46 |
{ |
| 47 |
y++; /* { dg-bogus "'y' not specified in enclosing 'teams'" } */ |
| 48 |
w++; /* { dg-bogus "'w' not specified in enclosing 'teams'" } */ |
| 49 |
S::s++; /* { dg-bogus "'S::s' not specified in enclosing 'teams'" } */ |
| 50 |
N::x++; /* { dg-error "'x' not specified in enclosing 'teams'" } */ |
| 51 |
N::z++; /* { dg-error "'z' not specified in enclosing 'teams'" } */ |
| 52 |
#if __cpp_variable_templates >= 201304 |
| 53 |
t<5>++; /* { dg-error "'t' not specified in enclosing 'teams'" "" { target c++14 } } */ |
| 54 |
#endif |
| 55 |
} |
| 56 |
#pragma omp parallel default(firstprivate) /* { dg-message "note: enclosing 'parallel'" } */ |
| 57 |
{ |
| 58 |
y++; /* { dg-bogus "'y' not specified in enclosing 'parallel'" } */ |
| 59 |
w++; /* { dg-bogus "'w' not specified in enclosing 'parallel'" } */ |
| 60 |
S::s++; /* { dg-bogus "'S::s' not specified in enclosing 'parallel'" } */ |
| 61 |
N::x++; /* { dg-error "'x' not specified in enclosing 'parallel'" } */ |
| 62 |
N::z++; /* { dg-error "'z' not specified in enclosing 'parallel'" } */ |
| 63 |
#if __cpp_variable_templates >= 201304 |
| 64 |
t<5>++; /* { dg-error "'t' not specified in enclosing 'parallel'" "" { target c++14 } } */ |
| 65 |
#endif |
| 66 |
} |
| 67 |
#pragma omp task default(private) /* { dg-message "note: enclosing 'task'" } */ |
| 68 |
{ |
| 69 |
y = 1; /* { dg-bogus "'y' not specified in enclosing 'task'" } */ |
| 70 |
w = 1; /* { dg-bogus "'w' not specified in enclosing 'task'" } */ |
| 71 |
S::s = 1; /* { dg-bogus "'S::s' not specified in enclosing 'task'" } */ |
| 72 |
N::x++; /* { dg-error "'x' not specified in enclosing 'task'" } */ |
| 73 |
N::z++; /* { dg-error "'z' not specified in enclosing 'task'" } */ |
| 74 |
#if __cpp_variable_templates >= 201304 |
| 75 |
t<5>++; /* { dg-error "'t' not specified in enclosing 'task'" "" { target c++14 } } */ |
| 76 |
#endif |
| 77 |
} |
| 78 |
#pragma omp taskloop default(private) /* { dg-message "note: enclosing 'taskloop'" } */ |
| 79 |
for (i = 0; i < 64; i++) |
| 80 |
{ |
| 81 |
y = 1; /* { dg-bogus "'y' not specified in enclosing 'taskloop'" } */ |
| 82 |
w = 1; /* { dg-bogus "'w' not specified in enclosing 'taskloop'" } */ |
| 83 |
S::s = 1; /* { dg-bogus "'S::s' not specified in enclosing 'taskloop'" } */ |
| 84 |
N::x++; /* { dg-error "'x' not specified in enclosing 'taskloop'" } */ |
| 85 |
N::z++; /* { dg-error "'z' not specified in enclosing 'taskloop'" } */ |
| 86 |
#if __cpp_variable_templates >= 201304 |
| 87 |
t<5>++; /* { dg-error "'t' not specified in enclosing 'taskloop'" "" { target c++14 } } */ |
| 88 |
#endif |
| 89 |
} |
| 90 |
#pragma omp teams default(private) /* { dg-message "note: enclosing 'teams'" } */ |
| 91 |
{ |
| 92 |
y = 1; /* { dg-bogus "'y' not specified in enclosing 'teams'" } */ |
| 93 |
w = 1; /* { dg-bogus "'w' not specified in enclosing 'teams'" } */ |
| 94 |
S::s = 1; /* { dg-bogus "'S::s' not specified in enclosing 'teams'" } */ |
| 95 |
N::x++; /* { dg-error "'x' not specified in enclosing 'teams'" } */ |
| 96 |
N::z++; /* { dg-error "'z' not specified in enclosing 'teams'" } */ |
| 97 |
#if __cpp_variable_templates >= 201304 |
| 98 |
t<5>++; /* { dg-error "'t' not specified in enclosing 'teams'" "" { target c++14 } } */ |
| 99 |
#endif |
| 100 |
} |
| 101 |
#pragma omp parallel default(private) /* { dg-message "note: enclosing 'parallel'" } */ |
| 102 |
{ |
| 103 |
y = 1; /* { dg-bogus "'y' not specified in enclosing 'parallel'" } */ |
| 104 |
w = 1; /* { dg-bogus "'w' not specified in enclosing 'parallel'" } */ |
| 105 |
S::s = 1; /* { dg-bogus "'S::s' not specified in enclosing 'parallel'" } */ |
| 106 |
N::x++; /* { dg-error "'x' not specified in enclosing 'parallel'" } */ |
| 107 |
N::z++; /* { dg-error "'z' not specified in enclosing 'parallel'" } */ |
| 108 |
#if __cpp_variable_templates >= 201304 |
| 109 |
t<5>++; /* { dg-error "'t' not specified in enclosing 'parallel'" "" { target c++14 } } */ |
| 110 |
#endif |
| 111 |
} |
| 112 |
} |