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