Home | History | Annotate | Download | only in OpenMP
      1 // RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit 100 -o - %s
      2 
      3 int foo();
      4 
      5 template <class T>
      6 T foo() {
      7   #pragma omp for ordered
      8   for (int i = 0; i < 10; ++i) {
      9     L1:
     10       foo();
     11     #pragma omp ordered
     12     {
     13       foo();
     14       goto L1; // expected-error {{use of undeclared label 'L1'}}
     15     }
     16   }
     17   #pragma omp for ordered
     18   for (int i = 0; i < 10; ++i) {
     19     foo();
     20     goto L2; // expected-error {{use of undeclared label 'L2'}}
     21     #pragma omp ordered
     22     {
     23       L2:
     24       foo();
     25     }
     26   }
     27 
     28   return T();
     29 }
     30 
     31 int foo() {
     32   #pragma omp for ordered
     33   for (int i = 0; i < 10; ++i) {
     34     L1:
     35       foo();
     36     #pragma omp ordered
     37     {
     38       foo();
     39       goto L1; // expected-error {{use of undeclared label 'L1'}}
     40     }
     41   }
     42   #pragma omp for ordered
     43   for (int i = 0; i < 10; ++i) {
     44     foo();
     45     goto L2; // expected-error {{use of undeclared label 'L2'}}
     46     #pragma omp ordered
     47     {
     48       L2:
     49       foo();
     50     }
     51   }
     52 
     53   return foo<int>();
     54 }
     55