brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 0a1c7ee Raw
119 lines · cpp
1// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized2 3// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized4 5template <class T>6T tmain(T argc) {7#pragma omp taskyield allocate(argc) // expected-error {{unexpected OpenMP clause 'allocate' in directive '#pragma omp taskyield'}}8  ;9#pragma omp taskyield untied  // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskyield'}}10#pragma omp taskyield unknown // expected-warning {{extra tokens at the end of '#pragma omp taskyield' are ignored}}11  if (argc)12#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}13    if (argc) {14#pragma omp taskyield15    }16  while (argc)17#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}18    while (argc) {19#pragma omp taskyield20    }21  do22#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}23    while (argc)24      ;25  do {26#pragma omp taskyield27  } while (argc);28  switch (argc)29#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}30    switch (argc)31    case 1:32#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}33  switch (argc)34  case 1: {35#pragma omp taskyield36  }37  switch (argc) {38#pragma omp taskyield39  case 1:40#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}41    break;42  default: {43#pragma omp taskyield44  } break;45  }46  for (;;)47#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}48    for (;;) {49#pragma omp taskyield50    }51label:52#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}53label1 : {54#pragma omp taskyield55}56if (1)57  label2:58#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}59 60  return T();61}62 63int main(int argc, char **argv) {64#pragma omp taskyield65  ;66#pragma omp taskyield untied  // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp taskyield'}}67#pragma omp taskyield unknown // expected-warning {{extra tokens at the end of '#pragma omp taskyield' are ignored}}68  if (argc)69#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}70    if (argc) {71#pragma omp taskyield72    }73  while (argc)74#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}75    while (argc) {76#pragma omp taskyield77    }78  do79#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}80    while (argc)81      ;82  do {83#pragma omp taskyield84  } while (argc);85  switch (argc)86#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}87    switch (argc)88    case 1:89#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}90  switch (argc)91  case 1: {92#pragma omp taskyield93  }94  switch (argc) {95#pragma omp taskyield96  case 1:97#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}98    break;99  default: {100#pragma omp taskyield101  } break;102  }103  for (;;)104#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}105    for (;;) {106#pragma omp taskyield107    }108label:109#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}110label1 : {111#pragma omp taskyield112}113if (1)114  label2:115#pragma omp taskyield // expected-error {{'#pragma omp taskyield' cannot be an immediate substatement}}116 117  return tmain(argc);118}119