Home | History | Annotate | Download | only in OpenMP
      1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s
      2 
      3 template <class T>
      4 T tmain(T argc) {
      5 #pragma omp taskyield
      6   ;
      7 #pragma omp taskyield untied  // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskyield'}}
      8 #pragma omp taskyield unknown // expected-warning {{extra tokens at the end of '#pragma omp taskyield' are ignored}}
      9   if (argc)
     10 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
     11     if (argc) {
     12 #pragma omp taskyield
     13     }
     14   while (argc)
     15 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
     16     while (argc) {
     17 #pragma omp taskyield
     18     }
     19   do
     20 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
     21     while (argc)
     22       ;
     23   do {
     24 #pragma omp taskyield
     25   } while (argc);
     26   switch (argc)
     27 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
     28     switch (argc)
     29     case 1:
     30 #pragma omp taskyield
     31   switch (argc)
     32   case 1: {
     33 #pragma omp taskyield
     34   }
     35   switch (argc) {
     36 #pragma omp taskyield
     37   case 1:
     38 #pragma omp taskyield
     39     break;
     40   default: {
     41 #pragma omp taskyield
     42   } break;
     43   }
     44   for (;;)
     45 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
     46     for (;;) {
     47 #pragma omp taskyield
     48     }
     49 label:
     50 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
     51 label1 : {
     52 #pragma omp taskyield
     53 }
     54 
     55   return T();
     56 }
     57 
     58 int main(int argc, char **argv) {
     59 #pragma omp taskyield
     60   ;
     61 #pragma omp taskyield untied  // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskyield'}}
     62 #pragma omp taskyield unknown // expected-warning {{extra tokens at the end of '#pragma omp taskyield' are ignored}}
     63   if (argc)
     64 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
     65     if (argc) {
     66 #pragma omp taskyield
     67     }
     68   while (argc)
     69 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
     70     while (argc) {
     71 #pragma omp taskyield
     72     }
     73   do
     74 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
     75     while (argc)
     76       ;
     77   do {
     78 #pragma omp taskyield
     79   } while (argc);
     80   switch (argc)
     81 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
     82     switch (argc)
     83     case 1:
     84 #pragma omp taskyield
     85   switch (argc)
     86   case 1: {
     87 #pragma omp taskyield
     88   }
     89   switch (argc) {
     90 #pragma omp taskyield
     91   case 1:
     92 #pragma omp taskyield
     93     break;
     94   default: {
     95 #pragma omp taskyield
     96   } break;
     97   }
     98   for (;;)
     99 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
    100     for (;;) {
    101 #pragma omp taskyield
    102     }
    103 label:
    104 #pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}
    105 label1 : {
    106 #pragma omp taskyield
    107 }
    108 
    109   return tmain(argc);
    110 }
    111