2019-07-08 23:45:24 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
|
2014-07-18 15:47:19 +08:00
|
|
|
|
2019-07-08 23:45:24 +08:00
|
|
|
// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
|
2017-12-30 02:07:07 +08:00
|
|
|
|
2014-07-18 15:47:19 +08:00
|
|
|
template <class T>
|
|
|
|
T tmain(T argc) {
|
2019-03-27 22:14:31 +08:00
|
|
|
#pragma omp taskyield allocate(argc) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp taskyield'}}
|
2014-07-18 15:47:19 +08:00
|
|
|
;
|
|
|
|
#pragma omp taskyield untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskyield'}}
|
|
|
|
#pragma omp taskyield unknown // expected-warning {{extra tokens at the end of '#pragma omp taskyield' are ignored}}
|
|
|
|
if (argc)
|
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
|
|
|
if (argc) {
|
|
|
|
#pragma omp taskyield
|
|
|
|
}
|
|
|
|
while (argc)
|
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
|
|
|
while (argc) {
|
|
|
|
#pragma omp taskyield
|
|
|
|
}
|
|
|
|
do
|
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
|
|
|
while (argc)
|
|
|
|
;
|
|
|
|
do {
|
|
|
|
#pragma omp taskyield
|
|
|
|
} while (argc);
|
|
|
|
switch (argc)
|
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
|
|
|
switch (argc)
|
|
|
|
case 1:
|
2019-02-15 08:27:53 +08:00
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
2014-07-18 15:47:19 +08:00
|
|
|
switch (argc)
|
|
|
|
case 1: {
|
|
|
|
#pragma omp taskyield
|
|
|
|
}
|
|
|
|
switch (argc) {
|
|
|
|
#pragma omp taskyield
|
|
|
|
case 1:
|
2016-01-13 19:18:54 +08:00
|
|
|
#pragma omp taskyield
|
2014-07-18 15:47:19 +08:00
|
|
|
break;
|
|
|
|
default: {
|
|
|
|
#pragma omp taskyield
|
|
|
|
} break;
|
|
|
|
}
|
|
|
|
for (;;)
|
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
|
|
|
for (;;) {
|
|
|
|
#pragma omp taskyield
|
|
|
|
}
|
|
|
|
label:
|
2019-02-15 08:27:53 +08:00
|
|
|
#pragma omp taskyield
|
2014-07-18 15:47:19 +08:00
|
|
|
label1 : {
|
|
|
|
#pragma omp taskyield
|
|
|
|
}
|
2019-02-15 08:27:53 +08:00
|
|
|
if (1)
|
|
|
|
label2:
|
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
2014-07-18 15:47:19 +08:00
|
|
|
|
|
|
|
return T();
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
#pragma omp taskyield
|
|
|
|
;
|
|
|
|
#pragma omp taskyield untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskyield'}}
|
|
|
|
#pragma omp taskyield unknown // expected-warning {{extra tokens at the end of '#pragma omp taskyield' are ignored}}
|
|
|
|
if (argc)
|
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
|
|
|
if (argc) {
|
|
|
|
#pragma omp taskyield
|
|
|
|
}
|
|
|
|
while (argc)
|
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
|
|
|
while (argc) {
|
|
|
|
#pragma omp taskyield
|
|
|
|
}
|
|
|
|
do
|
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
|
|
|
while (argc)
|
|
|
|
;
|
|
|
|
do {
|
|
|
|
#pragma omp taskyield
|
|
|
|
} while (argc);
|
|
|
|
switch (argc)
|
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
|
|
|
switch (argc)
|
|
|
|
case 1:
|
2019-02-15 08:27:53 +08:00
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
2014-07-18 15:47:19 +08:00
|
|
|
switch (argc)
|
|
|
|
case 1: {
|
|
|
|
#pragma omp taskyield
|
|
|
|
}
|
|
|
|
switch (argc) {
|
|
|
|
#pragma omp taskyield
|
|
|
|
case 1:
|
2016-01-13 19:18:54 +08:00
|
|
|
#pragma omp taskyield
|
2014-07-18 15:47:19 +08:00
|
|
|
break;
|
|
|
|
default: {
|
|
|
|
#pragma omp taskyield
|
|
|
|
} break;
|
|
|
|
}
|
|
|
|
for (;;)
|
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
|
|
|
for (;;) {
|
|
|
|
#pragma omp taskyield
|
|
|
|
}
|
|
|
|
label:
|
2019-02-15 08:27:53 +08:00
|
|
|
#pragma omp taskyield
|
2014-07-18 15:47:19 +08:00
|
|
|
label1 : {
|
|
|
|
#pragma omp taskyield
|
|
|
|
}
|
2019-02-15 08:27:53 +08:00
|
|
|
if (1)
|
|
|
|
label2:
|
|
|
|
#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
|
2014-07-18 15:47:19 +08:00
|
|
|
|
|
|
|
return tmain(argc);
|
|
|
|
}
|