2015-05-20 12:24:19 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
|
2014-07-18 17:11:51 +08:00
|
|
|
|
|
|
|
template <class T>
|
|
|
|
T tmain(T argc) {
|
|
|
|
#pragma omp barrier
|
|
|
|
;
|
|
|
|
#pragma omp barrier untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp barrier'}}
|
|
|
|
#pragma omp barrier unknown // expected-warning {{extra tokens at the end of '#pragma omp barrier' are ignored}}
|
|
|
|
if (argc)
|
|
|
|
#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}}
|
|
|
|
if (argc) {
|
|
|
|
#pragma omp barrier
|
|
|
|
}
|
|
|
|
while (argc)
|
|
|
|
#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}}
|
|
|
|
while (argc) {
|
|
|
|
#pragma omp barrier
|
|
|
|
}
|
|
|
|
do
|
|
|
|
#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}}
|
|
|
|
while (argc)
|
|
|
|
;
|
|
|
|
do {
|
|
|
|
#pragma omp barrier
|
|
|
|
} while (argc);
|
|
|
|
switch (argc)
|
|
|
|
#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}}
|
|
|
|
switch (argc)
|
|
|
|
case 1:
|
2016-01-13 19:18:54 +08:00
|
|
|
#pragma omp barrier
|
2014-07-18 17:11:51 +08:00
|
|
|
switch (argc)
|
|
|
|
case 1: {
|
|
|
|
#pragma omp barrier
|
|
|
|
}
|
|
|
|
switch (argc) {
|
|
|
|
#pragma omp barrier
|
|
|
|
case 1:
|
2016-01-13 19:18:54 +08:00
|
|
|
#pragma omp barrier
|
2014-07-18 17:11:51 +08:00
|
|
|
break;
|
|
|
|
default: {
|
|
|
|
#pragma omp barrier
|
|
|
|
} break;
|
|
|
|
}
|
|
|
|
for (;;)
|
|
|
|
#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}}
|
|
|
|
for (;;) {
|
|
|
|
#pragma omp barrier
|
|
|
|
}
|
|
|
|
label:
|
|
|
|
#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}}
|
|
|
|
label1 : {
|
|
|
|
#pragma omp barrier
|
|
|
|
}
|
|
|
|
|
|
|
|
return T();
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
#pragma omp barrier
|
|
|
|
;
|
|
|
|
#pragma omp barrier untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp barrier'}}
|
|
|
|
#pragma omp barrier unknown // expected-warning {{extra tokens at the end of '#pragma omp barrier' are ignored}}
|
|
|
|
if (argc)
|
|
|
|
#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}}
|
|
|
|
if (argc) {
|
|
|
|
#pragma omp barrier
|
|
|
|
}
|
|
|
|
while (argc)
|
|
|
|
#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}}
|
|
|
|
while (argc) {
|
|
|
|
#pragma omp barrier
|
|
|
|
}
|
|
|
|
do
|
|
|
|
#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}}
|
|
|
|
while (argc)
|
|
|
|
;
|
|
|
|
do {
|
|
|
|
#pragma omp barrier
|
|
|
|
} while (argc);
|
|
|
|
switch (argc)
|
|
|
|
#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}}
|
|
|
|
switch (argc)
|
|
|
|
case 1:
|
2016-01-13 19:18:54 +08:00
|
|
|
#pragma omp barrier
|
2014-07-18 17:11:51 +08:00
|
|
|
switch (argc)
|
|
|
|
case 1: {
|
|
|
|
#pragma omp barrier
|
|
|
|
}
|
|
|
|
switch (argc) {
|
|
|
|
#pragma omp barrier
|
|
|
|
case 1:
|
2016-01-13 19:18:54 +08:00
|
|
|
#pragma omp barrier
|
2014-07-18 17:11:51 +08:00
|
|
|
break;
|
|
|
|
default: {
|
|
|
|
#pragma omp barrier
|
|
|
|
} break;
|
|
|
|
}
|
|
|
|
for (;;)
|
|
|
|
#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}}
|
|
|
|
for (;;) {
|
|
|
|
#pragma omp barrier
|
|
|
|
}
|
|
|
|
label:
|
|
|
|
#pragma omp barrier // expected-error {{'#pragma omp barrier' cannot be an immediate substatement}}
|
|
|
|
label1 : {
|
|
|
|
#pragma omp barrier
|
|
|
|
}
|
|
|
|
|
|
|
|
return tmain(argc);
|
|
|
|
}
|