Home | History | Annotate | Download | only in OpenMP
      1 // RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
      2 
      3 void foo() {
      4 }
      5 
      6 bool foobool(int argc) {
      7   return argc;
      8 }
      9 
     10 struct S1; // expected-note {{declared here}}
     11 class S2 {
     12   mutable int a;
     13 public:
     14   S2():a(0) { }
     15   S2 & operator =(S2 &s2) { return *this; }
     16 };
     17 class S3 {
     18   int a;
     19 public:
     20   S3():a(0) { }
     21   S3 &operator =(S3 &s3) { return *this; }
     22 };
     23 class S4 {
     24   int a;
     25   S4();
     26   S4 &operator =(const S4 &s4); // expected-note {{implicitly declared private here}}
     27 public:
     28   S4(int v):a(v) { }
     29 };
     30 class S5 {
     31   int a;
     32   S5():a(0) {}
     33   S5 &operator =(const S5 &s5) { return *this; } // expected-note {{implicitly declared private here}}
     34 public:
     35   S5(int v):a(v) { }
     36 };
     37 template <class T>
     38 class ST {
     39 public:
     40   static T s;
     41 };
     42 
     43 namespace A {
     44 double x;
     45 #pragma omp threadprivate(x)
     46 }
     47 namespace B {
     48 using A::x;
     49 }
     50 
     51 S2 k;
     52 S3 h;
     53 S4 l(3);
     54 S5 m(4);
     55 #pragma omp threadprivate(h, k, l, m)
     56 
     57 int main(int argc, char **argv) {
     58   int i;
     59   #pragma omp parallel copyin // expected-error {{expected '(' after 'copyin'}}
     60   #pragma omp parallel copyin ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
     61   #pragma omp parallel copyin () // expected-error {{expected expression}}
     62   #pragma omp parallel copyin (k // expected-error {{expected ')'}} expected-note {{to match this '('}}
     63   #pragma omp parallel copyin (h, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
     64   #pragma omp parallel copyin (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
     65   #pragma omp parallel copyin (l) // expected-error {{'operator=' is a private member of 'S4'}}
     66   #pragma omp parallel copyin (S1) // expected-error {{'S1' does not refer to a value}}
     67   #pragma omp parallel copyin (argv[1]) // expected-error {{expected variable name}}
     68   #pragma omp parallel copyin(i) // expected-error {{copyin variable must be threadprivate}}
     69   #pragma omp parallel copyin(m) // expected-error {{'operator=' is a private member of 'S5'}}
     70   #pragma omp parallel copyin(ST<int>::s) // expected-error {{copyin variable must be threadprivate}}
     71   #pragma omp parallel copyin(B::x)
     72   foo();
     73 
     74   return 0;
     75 }
     76