1 // RUN: %clang_cc1 -verify -fopenmp %s 2 3 int foo(); 4 main()5int main() { 6 #pragma omp taskgroup 7 ; 8 #pragma omp taskgroup unknown // expected-warning {{extra tokens at the end of '#pragma omp taskgroup' are ignored}} 9 foo(); 10 { 11 #pragma omp taskgroup 12 } // expected-error {{expected statement}} 13 #pragma omp taskgroup 14 #pragma omp taskgroup 15 for (int i = 0; i < 10; ++i) { 16 foo(); 17 #pragma omp parallel 18 #pragma omp for 19 for (int j = 0; j < 10; j++) { 20 foo(); 21 #pragma omp taskgroup 22 foo(); 23 } 24 } 25 #pragma omp taskgroup 26 #pragma omp taskgroup 27 for (int i = 0; i < 10; ++i) { 28 foo(); 29 #pragma omp parallel 30 #pragma omp for 31 for (int j = 0; j < 10; j++) { 32 #pragma omp taskgroup 33 foo(); 34 } 35 } 36 #pragma omp taskgroup 37 #pragma omp taskgroup 38 for (int i = 0; i < 10; ++i) { 39 foo(); 40 #pragma omp parallel 41 #pragma omp for 42 for (int j = 0; j < 10; j++) { 43 #pragma omp taskgroup 44 foo(); 45 } 46 } 47 48 return 0; 49 } 50 foo()51int foo() { 52 L1: 53 foo(); 54 #pragma omp taskgroup 55 { 56 foo(); 57 goto L1; // expected-error {{use of undeclared label 'L1'}} 58 } 59 goto L2; // expected-error {{use of undeclared label 'L2'}} 60 #pragma omp taskgroup 61 { 62 L2: 63 foo(); 64 } 65 66 return 0; 67 } 68