1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s 2 main(int argc,char ** argv)3int main(int argc, char **argv) { 4 #pragma omp cancellation // expected-error {{expected an OpenMP directive}} 5 #pragma omp cancellation point // expected-error {{one of 'for', 'parallel', 'sections' or 'taskgroup' is expected}} 6 ; 7 #pragma omp cancellation point parallel untied // expected-error {{unexpected OpenMP clause 'untied' in directive '#pragma omp cancellation point'}} 8 #pragma omp cancellation point unknown // expected-error {{one of 'for', 'parallel', 'sections' or 'taskgroup' is expected}} 9 #pragma omp cancellation point sections( // expected-warning {{extra tokens at the end of '#pragma omp cancellation point' are ignored}} 10 #pragma omp cancellation point for, ) // expected-warning {{extra tokens at the end of '#pragma omp cancellation point' are ignored}} 11 #pragma omp cancellation point taskgroup() // expected-warning {{extra tokens at the end of '#pragma omp cancellation point' are ignored}} 12 #pragma omp cancellation point parallel, if // expected-warning {{extra tokens at the end of '#pragma omp cancellation point' are ignored}} 13 if (argc) 14 #pragma omp cancellation point for // expected-error {{'#pragma omp cancellation point' cannot be an immediate substatement}} 15 if (argc) { 16 #pragma omp taskgroup 17 #pragma omp task 18 #pragma omp parallel 19 { 20 #pragma omp cancellation point taskgroup // expected-error {{region cannot be closely nested inside 'parallel' region}} 21 } 22 } 23 #pragma omp parallel 24 #pragma omp taskgroup 25 { 26 #pragma omp cancellation point taskgroup // expected-error {{region cannot be closely nested inside 'taskgroup' region}} 27 } 28 #pragma omp parallel 29 { 30 #pragma omp cancellation point for // expected-error {{region cannot be closely nested inside 'parallel' region}} 31 } 32 #pragma omp task 33 { 34 #pragma omp cancellation point sections // expected-error {{region cannot be closely nested inside 'task' region}} 35 } 36 #pragma omp sections 37 { 38 #pragma omp cancellation point parallel // expected-error {{region cannot be closely nested inside 'sections' region}} 39 } 40 while (argc) 41 #pragma omp cancellation point for // expected-error {{'#pragma omp cancellation point' cannot be an immediate substatement}} 42 while (argc) { 43 #pragma omp cancellation point sections 44 } 45 do 46 #pragma omp cancellation point parallel // expected-error {{'#pragma omp cancellation point' cannot be an immediate substatement}} 47 while (argc) 48 ; 49 do { 50 #pragma omp cancellation point taskgroup 51 } while (argc); 52 switch (argc) 53 #pragma omp cancellation point parallel // expected-error {{'#pragma omp cancellation point' cannot be an immediate substatement}} 54 switch (argc) 55 case 1: 56 #pragma omp cancellation point sections 57 switch (argc) 58 case 1: { 59 #pragma omp cancellation point for 60 } 61 switch (argc) { 62 #pragma omp cancellation point taskgroup 63 case 1: 64 #pragma omp cancellation point parallel 65 break; 66 default: { 67 #pragma omp cancellation point sections 68 } break; 69 } 70 for (;;) 71 #pragma omp cancellation point for // expected-error {{'#pragma omp cancellation point' cannot be an immediate substatement}} 72 for (;;) { 73 #pragma omp cancellation point taskgroup 74 } 75 label: 76 #pragma omp cancellation point parallel // expected-error {{'#pragma omp cancellation point' cannot be an immediate substatement}} 77 label1 : { 78 #pragma omp cancellation point sections 79 } 80 81 return 0; 82 } 83 84