r211096 - [OPENMP] Initial support for '#pragma omp for'.

Alexey Bataev a.bataev at hotmail.com
Tue Jun 17 19:46:28 PDT 2014


Hi Hal,
1.
> We should separate the errors for not having an accessible copy constructor vs. having an ambigious one (for which we should make sure we note the alternatives).
This will be separated when we'll start to generate helper expressions 
for actual instantiation of all private variables. This is a temporary 
solution.
2.
> I don't like 'predetermined as private', it does not tell me why. This is because it is not initialized, right?
This is from the standard:
> Certain variables and objects have predetermined data-sharing 
> attributes as follows:
> ...
>
>   * Variables with automatic storage duration that are declared in a
>     scope inside the
>
> construct are private.
> ...
3.
> Also with this: We should say "Must be shared because ..." and tell the user why.
Agree, though there is a lot of work to do it. I think we should prepare 
a separate patch for improving error messages.

4.
> Again here, please separate these errors (or tell the user which is the problem).
See the first comment.

Best regards,
Alexey Bataev
=============
Software Engineer
Intel Compiler Team

17.06.2014 17:29, Hal Finkel пишет:
> ----- Original Message -----
>> From: "Alexey Bataev" <a.bataev at hotmail.com>
>> To: cfe-commits at cs.uiuc.edu
>> Sent: Tuesday, June 17, 2014 6:49:22 AM
>> Subject: r211096 - [OPENMP] Initial support for '#pragma omp for'.
>>
>> Author: abataev
>> Date: Tue Jun 17 06:49:22 2014
>> New Revision: 211096
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=211096&view=rev
>> Log:
>> [OPENMP] Initial support for '#pragma omp for'.
>>
> [snip]
>   
>> Added: cfe/trunk/test/OpenMP/for_firstprivate_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_firstprivate_messages.cpp?rev=211096&view=auto
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/for_firstprivate_messages.cpp (added)
>> +++ cfe/trunk/test/OpenMP/for_firstprivate_messages.cpp Tue Jun 17
>> 06:49:22 2014
>> @@ -0,0 +1,293 @@
>> +// RUN: %clang_cc1 -verify -fopenmp=libiomp5 %s
>> +
>> +void foo() {
>> +}
>> +
>> +bool foobool(int argc) {
>> +  return argc;
>> +}
>> +
>> +struct S1; // expected-note 2 {{declared here}} expected-note 2
>> {{forward declaration of 'S1'}}
>> +extern S1 a;
>> +class S2 {
>> +  mutable int a;
>> +
>> +public:
>> +  S2() : a(0) {}
>> +  S2(S2 &s2) : a(s2.a) {}
>> +  static float S2s;
>> +  static const float S2sc;
>> +};
>> +const float S2::S2sc = 0;
>> +const S2 b;
>> +const S2 ba[5];
>> +class S3 {
>> +  int a;
>> +  S3 &operator=(const S3 &s3);
>> +
>> +public:
>> +  S3() : a(0) {}
>> +  S3(S3 &s3) : a(s3.a) {}
>> +};
>> +const S3 c;
>> +const S3 ca[5];
>> +extern const int f;
>> +class S4 { // expected-note 2 {{'S4' declared here}}
>> +  int a;
>> +  S4();
>> +  S4(const S4 &s4);
>> +
>> +public:
>> +  S4(int v) : a(v) {}
>> +};
>> +class S5 { // expected-note 4 {{'S5' declared here}}
>> +  int a;
>> +  S5(const S5 &s5) : a(s5.a) {}
>> +
>> +public:
>> +  S5() : a(0) {}
>> +  S5(int v) : a(v) {}
>> +};
>> +class S6 {
>> +  int a;
>> +  S6() : a(0) {}
>> +
>> +public:
>> +  S6(const S6 &s6) : a(s6.a) {}
>> +  S6(int v) : a(v) {}
>> +};
>> +
>> +S3 h;
>> +#pragma omp threadprivate(h) // expected-note 2 {{defined as
>> threadprivate or thread local}}
>> +
>> +template <class I, class C>
>> +int foomain(int argc, char **argv) {
>> +  I e(4); // expected-note {{'e' defined here}}
>> +  C g(5); // expected-note 2 {{'g' defined here}}
>> +  int i;
>> +  int &j = i;                // expected-note {{'j' defined here}}
>> +#pragma omp parallel
>> +#pragma omp for firstprivate // expected-error {{expected '(' after
>> 'firstprivate'}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for firstprivate( // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for firstprivate() // expected-error {{expected
>> expression}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(argc // expected-error {{expected ')'}}
>> expected-note {{to match this '('}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(argc, // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(argc > 0 ? argv[1] : argv[2]) //
>> expected-error {{expected variable name}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(argc)
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(S1) // expected-error {{'S1' does not
>> refer to a value}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(a, b) // expected-error {{firstprivate
>> variable with incomplete type 'S1'}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(argv[1]) // expected-error {{expected
>> variable name}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(e, g) // expected-error 2
>> {{firstprivate variable must have an accessible, unambiguous copy
>> constructor}}
> We should separate the errors for not having an accessible copy constructor vs. having an ambigious one (for which we should make sure we note the alternatives).
>
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(h) // expected-error {{threadprivate or
>> thread local variable cannot be firstprivate}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for linear(i) // expected-error {{unexpected OpenMP
>> clause 'linear' in directive '#pragma omp for'}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +  {
>> +    int v = 0;
>> +    int i;                      // expected-note {{predetermined as
>> private}}
> I don't like 'predetermined as private', it does not tell me why. This is because it is not initialized, right?
>
>> +#pragma omp for firstprivate(i) // expected-error {{private variable
>> cannot be firstprivate}}
>> +    for (int k = 0; k < argc; ++k) {
>> +      i = k;
>> +      v += i;
>> +    }
>> +  }
>> +#pragma omp parallel shared(i)
>> +#pragma omp parallel private(i)
>> +#pragma omp for firstprivate(j) // expected-error {{arguments of
>> OpenMP clause 'firstprivate' cannot be of reference type}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(i)
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(g) firstprivate(g) // expected-error
>> {{firstprivate variable must have an accessible, unambiguous copy
>> constructor}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel private(i) // expected-note {{defined as
>> private}}
>> +#pragma omp for firstprivate(i) // expected-error {{firstprivate
>> variable must be shared}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel reduction(+ : i) // expected-note {{defined as
>> reduction}}
>> +#pragma omp for firstprivate(i) // expected-error {{firstprivate
>> variable must be shared}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +  return 0;
>> +}
>> +
>> +int main(int argc, char **argv) {
>> +  const int d = 5;
>> +  const int da[5] = {0};
>> +  S4 e(4); // expected-note {{'e' defined here}}
>> +  S5 g(5); // expected-note 2 {{'g' defined here}}
>> +  S3 m;
>> +  S6 n(2);
>> +  int i;
>> +  int &j = i;                // expected-note {{'j' defined here}}
>> +#pragma omp parallel
>> +#pragma omp for firstprivate // expected-error {{expected '(' after
>> 'firstprivate'}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate( // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate() // expected-error {{expected
>> expression}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(argc // expected-error {{expected ')'}}
>> expected-note {{to match this '('}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(argc, // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(argc > 0 ? argv[1] : argv[2]) //
>> expected-error {{expected variable name}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(argc)
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(S1) // expected-error {{'S1' does not
>> refer to a value}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(a, b, c, d, f) // expected-error
>> {{firstprivate variable with incomplete type 'S1'}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(argv[1]) // expected-error {{expected
>> variable name}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(2 * 2) // expected-error {{expected
>> variable name}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(ba) // OK
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(ca) // OK
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(da) // OK
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +  int xa;
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(xa) // OK
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(S2::S2s) // OK
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(S2::S2sc) // OK
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for safelen(5) // expected-error {{unexpected OpenMP
>> clause 'safelen' in directive '#pragma omp for'}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(e, g) // expected-error 2
>> {{firstprivate variable must have an accessible, unambiguous copy
>> constructor}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(m) // OK
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(h) // expected-error {{threadprivate or
>> thread local variable cannot be firstprivate}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for private(xa), firstprivate(xa) // expected-error
>> {{private variable cannot be firstprivate}} expected-note {{defined
>> as private}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(i) // expected-note {{defined as
>> firstprivate}}
>> +  for (i = 0; i < argc; ++i)    // expected-error {{loop iteration
>> variable may not be firstprivate}}
>> +    foo();
>> +#pragma omp parallel shared(xa)
>> +#pragma omp for firstprivate(xa) // OK: may be firstprivate
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(j) // expected-error {{arguments of
>> OpenMP clause 'firstprivate' cannot be of reference type}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(g) firstprivate(g) // expected-error
>> {{firstprivate variable must have an accessible, unambiguous copy
>> constructor}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(n) firstprivate(n) // OK
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +  {
>> +    int v = 0;
>> +    int i;                      // expected-note {{predetermined as
>> private}}
>> +#pragma omp for firstprivate(i) // expected-error {{private variable
>> cannot be firstprivate}}
>> +    for (int k = 0; k < argc; ++k) {
>> +      i = k;
>> +      v += i;
>> +    }
>> +  }
>> +#pragma omp parallel private(i) // expected-note {{defined as
>> private}}
>> +#pragma omp for firstprivate(i) // expected-error {{firstprivate
>> variable must be shared}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel reduction(+ : i) // expected-note {{defined as
>> reduction}}
>> +#pragma omp for firstprivate(i) // expected-error {{firstprivate
>> variable must be shared}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +
>> +  return foomain<S4, S5>(argc, argv); // expected-note {{in
>> instantiation of function template specialization 'foomain<S4, S5>'
>> requested here}}
>> +}
>>
>> Propchange: cfe/trunk/test/OpenMP/for_firstprivate_messages.cpp
>> ------------------------------------------------------------------------------
>>      svn:eol-style = native
>>
>> Propchange: cfe/trunk/test/OpenMP/for_firstprivate_messages.cpp
>> ------------------------------------------------------------------------------
>>      svn:keywords = Author Date Id Rev URL
>>
>> Propchange: cfe/trunk/test/OpenMP/for_firstprivate_messages.cpp
>> ------------------------------------------------------------------------------
>>      svn:mime-type = text/plain
>>
>> Added: cfe/trunk/test/OpenMP/for_lastprivate_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_lastprivate_messages.cpp?rev=211096&view=auto
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/for_lastprivate_messages.cpp (added)
>> +++ cfe/trunk/test/OpenMP/for_lastprivate_messages.cpp Tue Jun 17
>> 06:49:22 2014
>> @@ -0,0 +1,266 @@
>> +// RUN: %clang_cc1 -verify -fopenmp=libiomp5 %s
>> +
>> +void foo() {
>> +}
>> +
>> +bool foobool(int argc) {
>> +  return argc;
>> +}
>> +
>> +struct S1; // expected-note 2 {{declared here}} expected-note 2
>> {{forward declaration of 'S1'}}
>> +extern S1 a;
>> +class S2 {
>> +  mutable int a;
>> +
>> +public:
>> +  S2() : a(0) {}
>> +  S2(S2 &s2) : a(s2.a) {}
>> +  static float S2s; // expected-note {{predetermined as shared}}
> Also with this: We should say "Must be shared because ..." and tell the user why.
>
>> +  static const float S2sc;
>> +};
>> +const float S2::S2sc = 0; // expected-note {{predetermined as
>> shared}}
>> +const S2 b;
>> +const S2 ba[5];
>> +class S3 { // expected-note 2 {{'S3' declared here}}
>> +  int a;
>> +  S3 &operator=(const S3 &s3);
>> +
>> +public:
>> +  S3() : a(0) {}
>> +  S3(S3 &s3) : a(s3.a) {}
>> +};
>> +const S3 c;         // expected-note {{predetermined as shared}}
>> +const S3 ca[5];     // expected-note {{predetermined as shared}}
>> +extern const int f; // expected-note {{predetermined as shared}}
>> +class S4 {          // expected-note 3 {{'S4' declared here}}
>> +  int a;
>> +  S4();
>> +  S4(const S4 &s4);
>> +
>> +public:
>> +  S4(int v) : a(v) {}
>> +};
>> +class S5 { // expected-note {{'S5' declared here}}
>> +  int a;
>> +  S5() : a(0) {}
>> +
>> +public:
>> +  S5(const S5 &s5) : a(s5.a) {}
>> +  S5(int v) : a(v) {}
>> +};
>> +class S6 {
>> +  int a;
>> +  S6() : a(0) {}
>> +
>> +public:
>> +  S6(const S6 &s6) : a(s6.a) {}
>> +  S6(int v) : a(v) {}
>> +};
>> +
>> +S3 h;
>> +#pragma omp threadprivate(h) // expected-note 2 {{defined as
>> threadprivate or thread local}}
>> +
>> +template <class I, class C>
>> +int foomain(int argc, char **argv) {
>> +  I e(4); // expected-note {{'e' defined here}}
>> +  I g(5); // expected-note {{'g' defined here}}
>> +  int i;
>> +  int &j = i; // expected-note {{'j' defined here}}
>> +#pragma omp parallel
>> +#pragma omp for lastprivate // expected-error {{expected '(' after
>> 'lastprivate'}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate( // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate() // expected-error {{expected
>> expression}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(argc // expected-error {{expected ')'}}
>> expected-note {{to match this '('}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(argc, // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(argc > 0 ? argv[1] : argv[2]) //
>> expected-error {{expected variable name}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(argc)
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(S1) // expected-error {{'S1' does not
>> refer to a value}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(a, b) // expected-error {{lastprivate
>> variable with incomplete type 'S1'}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(argv[1]) // expected-error {{expected
>> variable name}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(e, g) // expected-error 2 {{lastprivate
>> variable must have an accessible, unambiguous default constructor}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(h) // expected-error {{threadprivate or
>> thread local variable cannot be lastprivate}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for linear(i) // expected-error {{unexpected OpenMP
>> clause 'linear' in directive '#pragma omp for'}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +  {
>> +    int v = 0;
>> +    int i;                     // expected-note {{predetermined as
>> private}}
>> +#pragma omp for lastprivate(i) // expected-error {{lastprivate
>> variable must be shared}}
>> +    for (int k = 0; k < argc; ++k) {
>> +      i = k;
>> +      v += i;
>> +    }
>> +  }
>> +#pragma omp parallel shared(i)
>> +#pragma omp parallel private(i)
>> +#pragma omp for lastprivate(j) // expected-error {{arguments of
>> OpenMP clause 'lastprivate' cannot be of reference type}}
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(i)
>> +  for (int k = 0; k < argc; ++k)
>> +    ++k;
>> +  return 0;
>> +}
>> +
>> +int main(int argc, char **argv) {
>> +  const int d = 5;       // expected-note {{predetermined as
>> shared}}
>> +  const int da[5] = {0}; // expected-note {{predetermined as
>> shared}}
>> +  S4 e(4);               // expected-note {{'e' defined here}}
>> +  S5 g(5);               // expected-note {{'g' defined here}}
>> +  S3 m;                  // expected-note 2 {{'m' defined here}}
>> +  S6 n(2);
>> +  int i;
>> +  int &j = i; // expected-note {{'j' defined here}}
>> +#pragma omp parallel
>> +#pragma omp for lastprivate // expected-error {{expected '(' after
>> 'lastprivate'}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate( // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate() // expected-error {{expected
>> expression}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(argc // expected-error {{expected ')'}}
>> expected-note {{to match this '('}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(argc, // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(argc > 0 ? argv[1] : argv[2]) //
>> expected-error {{expected variable name}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(argc)
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(S1) // expected-error {{'S1' does not
>> refer to a value}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(a, b, c, d, f) // expected-error
>> {{lastprivate variable with incomplete type 'S1'}} expected-error 3
>> {{shared variable cannot be lastprivate}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(argv[1]) // expected-error {{expected
>> variable name}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(2 * 2) // expected-error {{expected
>> variable name}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(ba)
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(ca) // expected-error {{shared variable
>> cannot be lastprivate}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(da) // expected-error {{shared variable
>> cannot be lastprivate}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +  int xa;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(xa) // OK
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(S2::S2s) // expected-error {{shared
>> variable cannot be lastprivate}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(S2::S2sc) // expected-error {{shared
>> variable cannot be lastprivate}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for safelen(5) // expected-error {{unexpected OpenMP
>> clause 'safelen' in directive '#pragma omp for'}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(e, g) // expected-error 2 {{lastprivate
>> variable must have an accessible, unambiguous default constructor}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(m) // expected-error {{lastprivate
>> variable must have an accessible, unambiguous copy assignment
>> operator}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(h) // expected-error {{threadprivate or
>> thread local variable cannot be lastprivate}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for private(xa), lastprivate(xa) // expected-error
>> {{private variable cannot be lastprivate}} expected-note {{defined
>> as private}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(i)
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel private(xa) // expected-note {{defined as
>> private}}
>> +#pragma omp for lastprivate(xa)  // expected-error {{lastprivate
>> variable must be shared}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel reduction(+ : xa) // expected-note {{defined as
>> reduction}}
>> +#pragma omp for lastprivate(xa)        // expected-error
>> {{lastprivate variable must be shared}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(j) // expected-error {{arguments of
>> OpenMP clause 'lastprivate' cannot be of reference type}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for firstprivate(m) lastprivate(m) // expected-error
>> {{lastprivate variable must have an accessible, unambiguous copy
>> assignment operator}}
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(n) firstprivate(n) // OK
>> +  for (i = 0; i < argc; ++i)
>> +    foo();
>> +  return foomain<S4, S5>(argc, argv); // expected-note {{in
>> instantiation of function template specialization 'foomain<S4, S5>'
>> requested here}}
>> +}
>>
>> Propchange: cfe/trunk/test/OpenMP/for_lastprivate_messages.cpp
>> ------------------------------------------------------------------------------
>>      svn:eol-style = native
>>
>> Propchange: cfe/trunk/test/OpenMP/for_lastprivate_messages.cpp
>> ------------------------------------------------------------------------------
>>      svn:keywords = Author Date Id Rev URL
>>
>> Propchange: cfe/trunk/test/OpenMP/for_lastprivate_messages.cpp
>> ------------------------------------------------------------------------------
>>      svn:mime-type = text/plain
>>
>> Added: cfe/trunk/test/OpenMP/for_loop_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_loop_messages.cpp?rev=211096&view=auto
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/for_loop_messages.cpp (added)
>> +++ cfe/trunk/test/OpenMP/for_loop_messages.cpp Tue Jun 17 06:49:22
>> 2014
>> @@ -0,0 +1,680 @@
>> +// RUN: %clang_cc1 -fsyntax-only -fopenmp=libiomp5 -x c++ -std=c++11
>> -fexceptions -fcxx-exceptions -verify %s
>> +
>> +class S {
>> +  int a;
>> +  S() : a(0) {}
>> +
>> +public:
>> +  S(int v) : a(v) {}
>> +  S(const S &s) : a(s.a) {}
>> +};
>> +
>> +static int sii;
>> +#pragma omp threadprivate(sii) // expected-note {{defined as
>> threadprivate or thread local}}
>> +
>> +int test_iteration_spaces() {
>> +  const int N = 100;
>> +  float a[N], b[N], c[N];
>> +  int ii, jj, kk;
>> +  float fii;
>> +  double dii;
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (int i = 0; i < 10; i += 1) {
>> +    c[i] = a[i] + b[i];
>> +  }
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (char i = 0; i < 10; i++) {
>> +    c[i] = a[i] + b[i];
>> +  }
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (char i = 0; i < 10; i += '\1') {
>> +    c[i] = a[i] + b[i];
>> +  }
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (long long i = 0; i < 10; i++) {
>> +    c[i] = a[i] + b[i];
>> +  }
>> +#pragma omp parallel
>> +// expected-error at +2 {{expression must have integral or unscoped
>> enumeration type, not 'double'}}
>> +#pragma omp for
>> +  for (long long i = 0; i < 10; i += 1.5) {
>> +    c[i] = a[i] + b[i];
>> +  }
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (long long i = 0; i < 'z'; i += 1u) {
>> +    c[i] = a[i] + b[i];
>> +  }
>> +#pragma omp parallel
>> +// expected-error at +2 {{variable must be of integer or random access
>> iterator type}}
>> +#pragma omp for
>> +  for (float fi = 0; fi < 10.0; fi++) {
>> +    c[(int)fi] = a[(int)fi] + b[(int)fi];
>> +  }
>> +#pragma omp parallel
>> +// expected-error at +2 {{variable must be of integer or random access
>> iterator type}}
>> +#pragma omp for
>> +  for (double fi = 0; fi < 10.0; fi++) {
>> +    c[(int)fi] = a[(int)fi] + b[(int)fi];
>> +  }
>> +#pragma omp parallel
>> +// expected-error at +2 {{variable must be of integer or random access
>> iterator type}}
>> +#pragma omp for
>> +  for (int &ref = ii; ref < 10; ref++) {
>> +  }
>> +#pragma omp parallel
>> +// expected-error at +2 {{initialization clause of OpenMP for loop must
>> be of the form 'var = init' or 'T var = init'}}
>> +#pragma omp for
>> +  for (int i; i < 10; i++)
>> +    c[i] = a[i];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{initialization clause of OpenMP for loop must
>> be of the form 'var = init' or 'T var = init'}}
>> +#pragma omp for
>> +  for (int i = 0, j = 0; i < 10; ++i)
>> +    c[i] = a[i];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{initialization clause of OpenMP for loop must
>> be of the form 'var = init' or 'T var = init'}}
>> +#pragma omp for
>> +  for (; ii < 10; ++ii)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-warning at +3 {{expression result unused}}
>> +// expected-error at +2 {{initialization clause of OpenMP for loop must
>> be of the form 'var = init' or 'T var = init'}}
>> +#pragma omp for
>> +  for (ii + 1; ii < 10; ++ii)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{initialization clause of OpenMP for loop must
>> be of the form 'var = init' or 'T var = init'}}
>> +#pragma omp for
>> +  for (c[ii] = 0; ii < 10; ++ii)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// Ok to skip parenthesises.
>> +#pragma omp for
>> +  for (((ii)) = 0; ii < 10; ++ii)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{condition of OpenMP for loop must be a
>> relational comparison ('<', '<=', '>', or '>=') of loop variable
>> 'i'}}
>> +#pragma omp for
>> +  for (int i = 0; i; i++)
>> +    c[i] = a[i];
>> +
>> +#pragma omp parallel
>> +// expected-error at +3 {{condition of OpenMP for loop must be a
>> relational comparison ('<', '<=', '>', or '>=') of loop variable
>> 'i'}}
>> +// expected-error at +2 {{increment clause of OpenMP for loop must
>> perform simple addition or subtraction on loop variable 'i'}}
>> +#pragma omp for
>> +  for (int i = 0; jj < kk; ii++)
>> +    c[i] = a[i];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{condition of OpenMP for loop must be a
>> relational comparison ('<', '<=', '>', or '>=') of loop variable
>> 'i'}}
>> +#pragma omp for
>> +  for (int i = 0; !!i; i++)
>> +    c[i] = a[i];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{condition of OpenMP for loop must be a
>> relational comparison ('<', '<=', '>', or '>=') of loop variable
>> 'i'}}
>> +#pragma omp for
>> +  for (int i = 0; i != 1; i++)
>> +    c[i] = a[i];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{condition of OpenMP for loop must be a
>> relational comparison ('<', '<=', '>', or '>=') of loop variable
>> 'i'}}
>> +#pragma omp for
>> +  for (int i = 0;; i++)
>> +    c[i] = a[i];
>> +
>> +#pragma omp parallel
>> +// Ok.
>> +#pragma omp for
>> +  for (int i = 11; i > 10; i--)
>> +    c[i] = a[i];
>> +
>> +#pragma omp parallel
>> +// Ok.
>> +#pragma omp for
>> +  for (int i = 0; i < 10; ++i)
>> +    c[i] = a[i];
>> +
>> +#pragma omp parallel
>> +// Ok.
>> +#pragma omp for
>> +  for (ii = 0; ii < 10; ++ii)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{increment clause of OpenMP for loop must
>> perform simple addition or subtraction on loop variable 'ii'}}
>> +#pragma omp for
>> +  for (ii = 0; ii < 10; ++jj)
>> +    c[ii] = a[jj];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{increment clause of OpenMP for loop must
>> perform simple addition or subtraction on loop variable 'ii'}}
>> +#pragma omp for
>> +  for (ii = 0; ii < 10; ++++ii)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// Ok but undefined behavior (in general, cannot check that incr
>> +// is really loop-invariant).
>> +#pragma omp for
>> +  for (ii = 0; ii < 10; ii = ii + ii)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{expression must have integral or unscoped
>> enumeration type, not 'float'}}
>> +#pragma omp for
>> +  for (ii = 0; ii < 10; ii = ii + 1.0f)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// Ok - step was converted to integer type.
>> +#pragma omp for
>> +  for (ii = 0; ii < 10; ii = ii + (int)1.1f)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{increment clause of OpenMP for loop must
>> perform simple addition or subtraction on loop variable 'ii'}}
>> +#pragma omp for
>> +  for (ii = 0; ii < 10; jj = ii + 2)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-warning at +3 {{relational comparison result unused}}
>> +// expected-error at +2 {{increment clause of OpenMP for loop must
>> perform simple addition or subtraction on loop variable 'ii'}}
>> +#pragma omp for
>> +  for (ii = 0; ii<10; jj> kk + 2)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{increment clause of OpenMP for loop must
>> perform simple addition or subtraction on loop variable 'ii'}}
>> +#pragma omp for
>> +  for (ii = 0; ii < 10;)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-warning at +3 {{expression result unused}}
>> +// expected-error at +2 {{increment clause of OpenMP for loop must
>> perform simple addition or subtraction on loop variable 'ii'}}
>> +#pragma omp for
>> +  for (ii = 0; ii < 10; !ii)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{increment clause of OpenMP for loop must
>> perform simple addition or subtraction on loop variable 'ii'}}
>> +#pragma omp for
>> +  for (ii = 0; ii < 10; ii ? ++ii : ++jj)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{increment clause of OpenMP for loop must
>> perform simple addition or subtraction on loop variable 'ii'}}
>> +#pragma omp for
>> +  for (ii = 0; ii < 10; ii = ii < 10)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be positive due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'ii' to
>> increase on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (ii = 0; ii < 10; ii = ii + 0)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be positive due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'ii' to
>> increase on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (ii = 0; ii < 10; ii = ii + (int)(0.8 - 0.45))
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be positive due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'ii' to
>> increase on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (ii = 0; (ii) < 10; ii -= 25)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be positive due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'ii' to
>> increase on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (ii = 0; (ii < 10); ii -= 0)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be negative due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'ii' to
>> decrease on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (ii = 0; ii > 10; (ii += 0))
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be positive due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'ii' to
>> increase on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (ii = 0; ii < 10; (ii) = (1 - 1) + (ii))
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be negative due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'ii' to
>> decrease on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for ((ii = 0); ii > 10; (ii -= 0))
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be positive due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'ii' to
>> increase on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (ii = 0; (ii < 10); (ii -= 0))
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-note at +2  {{defined as firstprivate}}
>> +// expected-error at +2 {{loop iteration variable may not be
>> firstprivate}}
>> +#pragma omp for firstprivate(ii)
>> +  for (ii = 0; ii < 10; ii++)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +// expected-error at +3 {{unexpected OpenMP clause 'linear' in
>> directive '#pragma omp for'}}
>> +// expected-note at +2  {{defined as linear}}
>> +// expected-error at +2 {{loop iteration variable may not be linear}}
>> +#pragma omp for linear(ii)
>> +  for (ii = 0; ii < 10; ii++)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +#pragma omp for private(ii)
>> +  for (ii = 0; ii < 10; ii++)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(ii)
>> +  for (ii = 0; ii < 10; ii++)
>> +    c[ii] = a[ii];
>> +
>> +#pragma omp parallel
>> +  {
>> +// expected-error at +2 {{loop iteration variable may not be
>> threadprivate or thread local}}
>> +#pragma omp for
>> +    for (sii = 0; sii < 10; sii += 1)
>> +      c[sii] = a[sii];
>> +  }
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{statement after '#pragma omp for' must be a
>> for loop}}
>> +#pragma omp for
>> +  for (auto &item : a) {
>> +    item = item + 1;
>> +  }
>> +
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be positive due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'i' to
>> increase on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (unsigned i = 9; i < 10; i--) {
>> +    c[i] = a[i] + b[i];
>> +  }
>> +
>> +  int(*lb)[4] = nullptr;
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (int(*p)[4] = lb; p < lb + 8; ++p) {
>> +  }
>> +
>> +#pragma omp parallel
>> +// expected-warning at +2 {{initialization clause of OpenMP for loop is
>> not in canonical form ('var = init' or 'T var = init')}}
>> +#pragma omp for
>> +  for (int a{0}; a < 10; ++a) {
>> +  }
>> +
>> +  return 0;
>> +}
>> +
>> +// Iterators allowed in openmp for-loops.
>> +namespace std {
>> +struct random_access_iterator_tag {};
>> +template <class Iter>
>> +struct iterator_traits {
>> +  typedef typename Iter::difference_type difference_type;
>> +  typedef typename Iter::iterator_category iterator_category;
>> +};
>> +template <class Iter>
>> +typename iterator_traits<Iter>::difference_type
>> +distance(Iter first, Iter last) { return first - last; }
>> +}
>> +class Iter0 {
>> +public:
>> +  Iter0() {}
>> +  Iter0(const Iter0 &) {}
>> +  Iter0 operator++() { return *this; }
>> +  Iter0 operator--() { return *this; }
>> +  bool operator<(Iter0 a) { return true; }
>> +};
>> +int operator-(Iter0 a, Iter0 b) { return 0; }
>> +class Iter1 {
>> +public:
>> +  Iter1(float f = 0.0f, double d = 0.0) {}
>> +  Iter1(const Iter1 &) {}
>> +  Iter1 operator++() { return *this; }
>> +  Iter1 operator--() { return *this; }
>> +  bool operator<(Iter1 a) { return true; }
>> +  bool operator>=(Iter1 a) { return false; }
>> +};
>> +class GoodIter {
>> +public:
>> +  GoodIter() {}
>> +  GoodIter(const GoodIter &) {}
>> +  GoodIter(int fst, int snd) {}
>> +  GoodIter &operator=(const GoodIter &that) { return *this; }
>> +  GoodIter &operator=(const Iter0 &that) { return *this; }
>> +  GoodIter &operator+=(int x) { return *this; }
>> +  explicit GoodIter(void *) {}
>> +  GoodIter operator++() { return *this; }
>> +  GoodIter operator--() { return *this; }
>> +  bool operator!() { return true; }
>> +  bool operator<(GoodIter a) { return true; }
>> +  bool operator<=(GoodIter a) { return true; }
>> +  bool operator>=(GoodIter a) { return false; }
>> +  typedef int difference_type;
>> +  typedef std::random_access_iterator_tag iterator_category;
>> +};
>> +int operator-(GoodIter a, GoodIter b) { return 0; }
>> +GoodIter operator-(GoodIter a) { return a; }
>> +GoodIter operator-(GoodIter a, int v) { return GoodIter(); }
>> +GoodIter operator+(GoodIter a, int v) { return GoodIter(); }
>> +GoodIter operator-(int v, GoodIter a) { return GoodIter(); }
>> +GoodIter operator+(int v, GoodIter a) { return GoodIter(); }
>> +
>> +int test_with_random_access_iterator() {
>> +  GoodIter begin, end;
>> +  Iter0 begin0, end0;
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (GoodIter I = begin; I < end; ++I)
>> +    ++I;
>> +#pragma omp parallel
>> +// expected-error at +2 {{variable must be of integer or random access
>> iterator type}}
>> +#pragma omp for
>> +  for (GoodIter &I = begin; I < end; ++I)
>> +    ++I;
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (GoodIter I = begin; I >= end; --I)
>> +    ++I;
>> +#pragma omp parallel
>> +// expected-warning at +2 {{initialization clause of OpenMP for loop is
>> not in canonical form ('var = init' or 'T var = init')}}
>> +#pragma omp for
>> +  for (GoodIter I(begin); I < end; ++I)
>> +    ++I;
>> +#pragma omp parallel
>> +// expected-warning at +2 {{initialization clause of OpenMP for loop is
>> not in canonical form ('var = init' or 'T var = init')}}
>> +#pragma omp for
>> +  for (GoodIter I(nullptr); I < end; ++I)
>> +    ++I;
>> +#pragma omp parallel
>> +// expected-warning at +2 {{initialization clause of OpenMP for loop is
>> not in canonical form ('var = init' or 'T var = init')}}
>> +#pragma omp for
>> +  for (GoodIter I(0); I < end; ++I)
>> +    ++I;
>> +#pragma omp parallel
>> +// expected-warning at +2 {{initialization clause of OpenMP for loop is
>> not in canonical form ('var = init' or 'T var = init')}}
>> +#pragma omp for
>> +  for (GoodIter I(1, 2); I < end; ++I)
>> +    ++I;
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (begin = GoodIter(0); begin < end; ++begin)
>> +    ++begin;
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (begin = begin0; begin < end; ++begin)
>> +    ++begin;
>> +#pragma omp parallel
>> +// expected-error at +2 {{initialization clause of OpenMP for loop must
>> be of the form 'var = init' or 'T var = init'}}
>> +#pragma omp for
>> +  for (++begin; begin < end; ++begin)
>> +    ++begin;
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (begin = end; begin < end; ++begin)
>> +    ++begin;
>> +#pragma omp parallel
>> +// expected-error at +2 {{condition of OpenMP for loop must be a
>> relational comparison ('<', '<=', '>', or '>=') of loop variable
>> 'I'}}
>> +#pragma omp for
>> +  for (GoodIter I = begin; I - I; ++I)
>> +    ++I;
>> +#pragma omp parallel
>> +// expected-error at +2 {{condition of OpenMP for loop must be a
>> relational comparison ('<', '<=', '>', or '>=') of loop variable
>> 'I'}}
>> +#pragma omp for
>> +  for (GoodIter I = begin; begin < end; ++I)
>> +    ++I;
>> +#pragma omp parallel
>> +// expected-error at +2 {{condition of OpenMP for loop must be a
>> relational comparison ('<', '<=', '>', or '>=') of loop variable
>> 'I'}}
>> +#pragma omp for
>> +  for (GoodIter I = begin; !I; ++I)
>> +    ++I;
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be negative due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'I' to
>> decrease on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (GoodIter I = begin; I >= end; I = I + 1)
>> +    ++I;
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (GoodIter I = begin; I >= end; I = I - 1)
>> +    ++I;
>> +#pragma omp parallel
>> +// expected-error at +2 {{increment clause of OpenMP for loop must
>> perform simple addition or subtraction on loop variable 'I'}}
>> +#pragma omp for
>> +  for (GoodIter I = begin; I >= end; I = -I)
>> +    ++I;
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be negative due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'I' to
>> decrease on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (GoodIter I = begin; I >= end; I = 2 + I)
>> +    ++I;
>> +#pragma omp parallel
>> +// expected-error at +2 {{increment clause of OpenMP for loop must
>> perform simple addition or subtraction on loop variable 'I'}}
>> +#pragma omp for
>> +  for (GoodIter I = begin; I >= end; I = 2 - I)
>> +    ++I;
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (Iter0 I = begin0; I < end0; ++I)
>> +    ++I;
>> +#pragma omp parallel
>> +// Initializer is constructor without params.
>> +// expected-warning at +2 {{initialization clause of OpenMP for loop is
>> not in canonical form ('var = init' or 'T var = init')}}
>> +#pragma omp for
>> +  for (Iter0 I; I < end0; ++I)
>> +    ++I;
>> +  Iter1 begin1, end1;
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (Iter1 I = begin1; I < end1; ++I)
>> +    ++I;
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be negative due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'I' to
>> decrease on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (Iter1 I = begin1; I >= end1; ++I)
>> +    ++I;
>> +#pragma omp parallel
>> +// Initializer is constructor with all default params.
>> +// expected-warning at +2 {{initialization clause of OpenMP for loop is
>> not in canonical form ('var = init' or 'T var = init')}}
>> +#pragma omp for
>> +  for (Iter1 I; I < end1; ++I) {
>> +  }
>> +  return 0;
>> +}
>> +
>> +template <typename IT, int ST>
>> +class TC {
>> +public:
>> +  int dotest_lt(IT begin, IT end) {
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be positive due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'I' to
>> increase on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +    for (IT I = begin; I < end; I = I + ST) {
>> +      ++I;
>> +    }
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be positive due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'I' to
>> increase on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +    for (IT I = begin; I <= end; I += ST) {
>> +      ++I;
>> +    }
>> +#pragma omp parallel
>> +#pragma omp for
>> +    for (IT I = begin; I < end; ++I) {
>> +      ++I;
>> +    }
>> +  }
>> +
>> +  static IT step() {
>> +    return IT(ST);
>> +  }
>> +};
>> +template <typename IT, int ST = 0>
>> +int dotest_gt(IT begin, IT end) {
>> +#pragma omp parallel
>> +// expected-note at +3 2 {{loop step is expected to be negative due to
>> this condition}}
>> +// expected-error at +2 2 {{increment expression must cause 'I' to
>> decrease on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (IT I = begin; I >= end; I = I + ST) {
>> +    ++I;
>> +  }
>> +#pragma omp parallel
>> +// expected-note at +3 2 {{loop step is expected to be negative due to
>> this condition}}
>> +// expected-error at +2 2 {{increment expression must cause 'I' to
>> decrease on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (IT I = begin; I >= end; I += ST) {
>> +    ++I;
>> +  }
>> +
>> +#pragma omp parallel
>> +// expected-note at +3 {{loop step is expected to be negative due to
>> this condition}}
>> +// expected-error at +2 {{increment expression must cause 'I' to
>> decrease on each iteration of OpenMP for loop}}
>> +#pragma omp for
>> +  for (IT I = begin; I >= end; ++I) {
>> +    ++I;
>> +  }
>> +
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (IT I = begin; I < end; I += TC<int, ST>::step()) {
>> +    ++I;
>> +  }
>> +}
>> +
>> +void test_with_template() {
>> +  GoodIter begin, end;
>> +  TC<GoodIter, 100> t1;
>> +  TC<GoodIter, -100> t2;
>> +  t1.dotest_lt(begin, end);
>> +  t2.dotest_lt(begin, end);         // expected-note {{in
>> instantiation of member function 'TC<GoodIter, -100>::dotest_lt'
>> requested here}}
>> +  dotest_gt(begin, end);            // expected-note {{in
>> instantiation of function template specialization
>> 'dotest_gt<GoodIter, 0>' requested here}}
>> +  dotest_gt<unsigned, -10>(0, 100); // expected-note {{in
>> instantiation of function template specialization
>> 'dotest_gt<unsigned int, -10>' requested here}}
>> +}
>> +
>> +void test_loop_break() {
>> +  const int N = 100;
>> +  float a[N], b[N], c[N];
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (int i = 0; i < 10; i++) {
>> +    c[i] = a[i] + b[i];
>> +    for (int j = 0; j < 10; ++j) {
>> +      if (a[i] > b[j])
>> +        break; // OK in nested loop
>> +    }
>> +    switch (i) {
>> +    case 1:
>> +      b[i]++;
>> +      break;
>> +    default:
>> +      break;
>> +    }
>> +    if (c[i] > 10)
>> +      break; // expected-error {{'break' statement cannot be used in
>> OpenMP for loop}}
>> +
>> +    if (c[i] > 11)
>> +      break; // expected-error {{'break' statement cannot be used in
>> OpenMP for loop}}
>> +  }
>> +
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (int i = 0; i < 10; i++) {
>> +    for (int j = 0; j < 10; j++) {
>> +      c[i] = a[i] + b[i];
>> +      if (c[i] > 10) {
>> +        if (c[i] < 20) {
>> +          break; // OK
>> +        }
>> +      }
>> +    }
>> +  }
>> +}
>> +
>> +void test_loop_eh() {
>> +  const int N = 100;
>> +  float a[N], b[N], c[N];
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (int i = 0; i < 10; i++) {
>> +    c[i] = a[i] + b[i];
>> +    try {
>> +      for (int j = 0; j < 10; ++j) {
>> +        if (a[i] > b[j])
>> +          throw a[i];
>> +      }
>> +      throw a[i];
>> +    } catch (float f) {
>> +      if (f > 0.1)
>> +        throw a[i];
>> +      return; // expected-error {{cannot return from OpenMP region}}
>> +    }
>> +    switch (i) {
>> +    case 1:
>> +      b[i]++;
>> +      break;
>> +    default:
>> +      break;
>> +    }
>> +    for (int j = 0; j < 10; j++) {
>> +      if (c[i] > 10)
>> +        throw c[i];
>> +    }
>> +  }
>> +  if (c[9] > 10)
>> +    throw c[9]; // OK
>> +
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (int i = 0; i < 10; ++i) {
>> +    struct S {
>> +      void g() { throw 0; }
>> +    };
>> +  }
>> +}
>> +
>> +void test_loop_firstprivate_lastprivate() {
>> +  S s(4);
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(s) firstprivate(s)
>> +  for (int i = 0; i < 16; ++i)
>> +    ;
>> +}
>>
>> Propchange: cfe/trunk/test/OpenMP/for_loop_messages.cpp
>> ------------------------------------------------------------------------------
>>      svn:eol-style = native
>>
>> Propchange: cfe/trunk/test/OpenMP/for_loop_messages.cpp
>> ------------------------------------------------------------------------------
>>      svn:keywords = Author Date Id Rev URL
>>
>> Propchange: cfe/trunk/test/OpenMP/for_loop_messages.cpp
>> ------------------------------------------------------------------------------
>>      svn:mime-type = text/plain
>>
>> Added: cfe/trunk/test/OpenMP/for_misc_messages.c
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_misc_messages.c?rev=211096&view=auto
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/for_misc_messages.c (added)
>> +++ cfe/trunk/test/OpenMP/for_misc_messages.c Tue Jun 17 06:49:22
>> 2014
>> @@ -0,0 +1,362 @@
>> +// RUN: %clang_cc1 -fsyntax-only -fopenmp=libiomp5 -verify %s
>> +
>> +// expected-error at +1 {{unexpected OpenMP directive '#pragma omp
>> for'}}
>> +#pragma omp for
>> +
>> +// expected-error at +1 {{unexpected OpenMP directive '#pragma omp
>> for'}}
>> +#pragma omp for foo
>> +
>> +void test_no_clause() {
>> +  int i;
>> +#pragma omp for
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +
>> +// expected-error at +2 {{statement after '#pragma omp for' must be a
>> for loop}}
>> +#pragma omp for
>> +  ++i;
>> +}
>> +
>> +void test_branch_protected_scope() {
>> +  int i = 0;
>> +L1:
>> +  ++i;
>> +
>> +  int x[24];
>> +
>> +#pragma omp parallel
>> +#pragma omp for
>> +  for (i = 0; i < 16; ++i) {
>> +    if (i == 5)
>> +      goto L1; // expected-error {{use of undeclared label 'L1'}}
>> +    else if (i == 6)
>> +      return; // expected-error {{cannot return from OpenMP region}}
>> +    else if (i == 7)
>> +      goto L2;
>> +    else if (i == 8) {
>> +    L2:
>> +      x[i]++;
>> +    }
>> +  }
>> +
>> +  if (x[0] == 0)
>> +    goto L2; // expected-error {{use of undeclared label 'L2'}}
>> +  else if (x[1] == 1)
>> +    goto L1;
>> +}
>> +
>> +void test_invalid_clause() {
>> +  int i;
>> +#pragma omp parallel
>> +// expected-warning at +1 {{extra tokens at the end of '#pragma omp
>> for' are ignored}}
>> +#pragma omp for foo bar
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +}
>> +
>> +void test_non_identifiers() {
>> +  int i, x;
>> +
>> +#pragma omp parallel
>> +// expected-warning at +1 {{extra tokens at the end of '#pragma omp
>> for' are ignored}}
>> +#pragma omp for;
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +2 {{unexpected OpenMP clause 'linear' in
>> directive '#pragma omp for'}}
>> +// expected-warning at +1 {{extra tokens at the end of '#pragma omp
>> for' are ignored}}
>> +#pragma omp for linear(x);
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +
>> +#pragma omp parallel
>> +// expected-warning at +1 {{extra tokens at the end of '#pragma omp
>> for' are ignored}}
>> +#pragma omp for private(x);
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +
>> +#pragma omp parallel
>> +// expected-warning at +1 {{extra tokens at the end of '#pragma omp
>> for' are ignored}}
>> +#pragma omp for, private(x);
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +}
>> +
>> +extern int foo();
>> +
>> +void test_collapse() {
>> +  int i;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected '('}}
>> +#pragma omp for collapse
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected expression}} expected-error at +1
>> {{expected ')'}} expected-note at +1 {{to match this '('}}
>> +#pragma omp for collapse(
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected expression}}
>> +#pragma omp for collapse()
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected expression}} expected-error at +1
>> {{expected ')'}} expected-note at +1 {{to match this '('}}
>> +#pragma omp for collapse(,
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected expression}}  expected-error at +1
>> {{expected ')'}} expected-note at +1 {{to match this '('}}
>> +#pragma omp for collapse(, )
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-warning at +2 {{extra tokens at the end of '#pragma omp
>> for' are ignored}}
>> +// expected-error at +1 {{expected '('}}
>> +#pragma omp for collapse 4)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +2 {{expected ')'}}
>> +// expected-note at +1 {{to match this '('}}
>> +#pragma omp for collapse(4
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +2 {{expected ')'}}
>> +// expected-note at +1 {{to match this '('}}
>> +#pragma omp for collapse(4,
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +2 {{expected ')'}}
>> +// expected-note at +1 {{to match this '('}}
>> +#pragma omp for collapse(4, )
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +#pragma omp for collapse(4)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +2 {{expected ')'}}
>> +// expected-note at +1 {{to match this '('}}
>> +#pragma omp for collapse(4 4)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +2 {{expected ')'}}
>> +// expected-note at +1 {{to match this '('}}
>> +#pragma omp for collapse(4, , 4)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +#pragma omp for collapse(4)
>> +  for (int i1 = 0; i1 < 16; ++i1)
>> +    for (int i2 = 0; i2 < 16; ++i2)
>> +      for (int i3 = 0; i3 < 16; ++i3)
>> +        for (int i4 = 0; i4 < 16; ++i4)
>> +          foo();
>> +#pragma omp parallel
>> +// expected-error at +2 {{expected ')'}}
>> +// expected-note at +1 {{to match this '('}}
>> +#pragma omp for collapse(4, 8)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expression is not an integer constant
>> expression}}
>> +#pragma omp for collapse(2.5)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expression is not an integer constant
>> expression}}
>> +#pragma omp for collapse(foo())
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{argument to 'collapse' clause must be a
>> positive integer value}}
>> +#pragma omp for collapse(-5)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{argument to 'collapse' clause must be a
>> positive integer value}}
>> +#pragma omp for collapse(0)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{argument to 'collapse' clause must be a
>> positive integer value}}
>> +#pragma omp for collapse(5 - 5)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +}
>> +
>> +void test_private() {
>> +  int i;
>> +#pragma omp parallel
>> +// expected-error at +2 {{expected expression}}
>> +// expected-error at +1 {{expected ')'}} expected-note at +1 {{to match
>> this '('}}
>> +#pragma omp for private(
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +2 {{expected ')'}} expected-note at +2 {{to match
>> this '('}}
>> +// expected-error at +1 2 {{expected expression}}
>> +#pragma omp for private(,
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 2 {{expected expression}}
>> +#pragma omp for private(, )
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected expression}}
>> +#pragma omp for private()
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected expression}}
>> +#pragma omp for private(int)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected variable name}}
>> +#pragma omp for private(0)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +
>> +  int x, y, z;
>> +#pragma omp parallel
>> +#pragma omp for private(x)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +#pragma omp for private(x, y)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +#pragma omp for private(x, y, z)
>> +  for (i = 0; i < 16; ++i) {
>> +    x = y * i + z;
>> +  }
>> +}
>> +
>> +void test_lastprivate() {
>> +  int i;
>> +#pragma omp parallel
>> +// expected-error at +2 {{expected ')'}} expected-note at +2 {{to match
>> this '('}}
>> +// expected-error at +1 {{expected expression}}
>> +#pragma omp for lastprivate(
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{expected ')'}} expected-note at +2 {{to match
>> this '('}}
>> +// expected-error at +1 2 {{expected expression}}
>> +#pragma omp for lastprivate(,
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 2 {{expected expression}}
>> +#pragma omp for lastprivate(, )
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected expression}}
>> +#pragma omp for lastprivate()
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected expression}}
>> +#pragma omp for lastprivate(int)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected variable name}}
>> +#pragma omp for lastprivate(0)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +
>> +  int x, y, z;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(x)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(x, y)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(x, y, z)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +}
>> +
>> +void test_firstprivate() {
>> +  int i;
>> +#pragma omp parallel
>> +// expected-error at +2 {{expected ')'}} expected-note at +2 {{to match
>> this '('}}
>> +// expected-error at +1 {{expected expression}}
>> +#pragma omp for firstprivate(
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +
>> +#pragma omp parallel
>> +// expected-error at +2 {{expected ')'}} expected-note at +2 {{to match
>> this '('}}
>> +// expected-error at +1 2 {{expected expression}}
>> +#pragma omp for firstprivate(,
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 2 {{expected expression}}
>> +#pragma omp for firstprivate(, )
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected expression}}
>> +#pragma omp for firstprivate()
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected expression}}
>> +#pragma omp for firstprivate(int)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +// expected-error at +1 {{expected variable name}}
>> +#pragma omp for firstprivate(0)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +
>> +  int x, y, z;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(x) firstprivate(x)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(x, y) firstprivate(x, y)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +#pragma omp parallel
>> +#pragma omp for lastprivate(x, y, z) firstprivate(x, y, z)
>> +  for (i = 0; i < 16; ++i)
>> +    ;
>> +}
>> +
>> +void test_loop_messages() {
>> +  float a[100], b[100], c[100];
>> +#pragma omp parallel
>> +// expected-error at +2 {{variable must be of integer or pointer type}}
>> +#pragma omp for
>> +  for (float fi = 0; fi < 10.0; fi++) {
>> +    c[(int)fi] = a[(int)fi] + b[(int)fi];
>> +  }
>> +#pragma omp parallel
>> +// expected-error at +2 {{variable must be of integer or pointer type}}
>> +#pragma omp for
>> +  for (double fi = 0; fi < 10.0; fi++) {
>> +    c[(int)fi] = a[(int)fi] + b[(int)fi];
>> +  }
>> +}
>> +
>>
>> Propchange: cfe/trunk/test/OpenMP/for_misc_messages.c
>> ------------------------------------------------------------------------------
>>      svn:eol-style = native
>>
>> Propchange: cfe/trunk/test/OpenMP/for_misc_messages.c
>> ------------------------------------------------------------------------------
>>      svn:keywords = Author Date Id Rev URL
>>
>> Propchange: cfe/trunk/test/OpenMP/for_misc_messages.c
>> ------------------------------------------------------------------------------
>>      svn:mime-type = text/plain
>>
>> Added: cfe/trunk/test/OpenMP/for_private_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_private_messages.cpp?rev=211096&view=auto
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/for_private_messages.cpp (added)
>> +++ cfe/trunk/test/OpenMP/for_private_messages.cpp Tue Jun 17
>> 06:49:22 2014
>> @@ -0,0 +1,134 @@
>> +// RUN: %clang_cc1 -verify -fopenmp=libiomp5 %s
>> +
>> +void foo() {
>> +}
>> +
>> +bool foobool(int argc) {
>> +  return argc;
>> +}
>> +
>> +struct S1; // expected-note 2 {{declared here}} expected-note 2
>> {{forward declaration of 'S1'}}
>> +extern S1 a;
>> +class S2 {
>> +  mutable int a;
>> +public:
>> +  S2():a(0) { }
>> +};
>> +const S2 b;
>> +const S2 ba[5];
>> +class S3 {
>> +  int a;
>> +public:
>> +  S3():a(0) { }
>> +};
>> +const S3 ca[5];
>> +class S4 { // expected-note {{'S4' declared here}}
>> +  int a;
>> +  S4();
>> +public:
>> +  S4(int v):a(v) { }
>> +};
>> +class S5 { // expected-note {{'S5' declared here}}
>> +  int a;
>> +  S5():a(0) {}
>> +public:
>> +  S5(int v):a(v) { }
>> +};
>> +
>> +S3 h;
>> +#pragma omp threadprivate(h) // expected-note 2 {{defined as
>> threadprivate or thread local}}
>> +
>> +template<class I, class C> int foomain(I argc, C **argv) {
>> +  I e(4);
>> +  I g(5);
>> +  int i;
>> +  int &j = i; // expected-note {{'j' defined here}}
>> +  #pragma omp for private // expected-error {{expected '(' after
>> 'private'}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private ( // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private () // expected-error {{expected
>> expression}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (argc // expected-error {{expected ')'}}
>> expected-note {{to match this '('}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (argc, // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (argc > 0 ? argv[1] : argv[2]) //
>> expected-error {{expected variable name}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (argc)
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (S1) // expected-error {{'S1' does not
>> refer to a value}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (a, b) // expected-error {{private
>> variable with incomplete type 'S1'}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (argv[1]) // expected-error {{expected
>> variable name}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private(e, g)
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private(h) // expected-error {{threadprivate or
>> thread local variable cannot be private}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for shared(i) // expected-error {{unexpected OpenMP
>> clause 'shared' in directive '#pragma omp for'}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp parallel
>> +  {
>> +    int v = 0;
>> +    int i;
>> +    #pragma omp for private(i)
>> +    for (int k = 0; k < argc; ++k) { i = k; v += i; }
>> +  }
>> +  #pragma omp parallel shared(i)
>> +  #pragma omp parallel private(i)
>> +  #pragma omp for private(j) // expected-error {{arguments of OpenMP
>> clause 'private' cannot be of reference type}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private(i)
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  return 0;
>> +}
>> +
>> +int main(int argc, char **argv) {
>> +  S4 e(4); // expected-note {{'e' defined here}}
>> +  S5 g(5); // expected-note {{'g' defined here}}
>> +  int i;
>> +  int &j = i; // expected-note {{'j' defined here}}
>> +  #pragma omp for private // expected-error {{expected '(' after
>> 'private'}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private ( // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private () // expected-error {{expected
>> expression}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (argc // expected-error {{expected ')'}}
>> expected-note {{to match this '('}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (argc, // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (argc > 0 ? argv[1] : argv[2]) //
>> expected-error {{expected variable name}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (argc)
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (S1) // expected-error {{'S1' does not
>> refer to a value}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (a, b) // expected-error {{private
>> variable with incomplete type 'S1'}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private (argv[1]) // expected-error {{expected
>> variable name}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private(e, g) // expected-error 2 {{private
>> variable must have an accessible, unambiguous default constructor}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private(h) // expected-error {{threadprivate or
>> thread local variable cannot be private}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for shared(i) // expected-error {{unexpected OpenMP
>> clause 'shared' in directive '#pragma omp for'}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp parallel
>> +  {
>> +    int i;
>> +    #pragma omp for private(i)
>> +    for (int k = 0; k < argc; ++k) ++k;
>> +  }
>> +  #pragma omp parallel shared(i)
>> +  #pragma omp parallel private(i)
>> +  #pragma omp for private(j) // expected-error {{arguments of OpenMP
>> clause 'private' cannot be of reference type}}
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +  #pragma omp for private(i)
>> +  for (int k = 0; k < argc; ++k) ++k;
>> +
>> +  return 0;
>> +}
>> +
>>
>> Propchange: cfe/trunk/test/OpenMP/for_private_messages.cpp
>> ------------------------------------------------------------------------------
>>      svn:eol-style = native
>>
>> Propchange: cfe/trunk/test/OpenMP/for_private_messages.cpp
>> ------------------------------------------------------------------------------
>>      svn:keywords = Author Date Id Rev URL
>>
>> Propchange: cfe/trunk/test/OpenMP/for_private_messages.cpp
>> ------------------------------------------------------------------------------
>>      svn:mime-type = text/plain
>>
>> Added: cfe/trunk/test/OpenMP/for_reduction_messages.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/for_reduction_messages.cpp?rev=211096&view=auto
>> ==============================================================================
>> --- cfe/trunk/test/OpenMP/for_reduction_messages.cpp (added)
>> +++ cfe/trunk/test/OpenMP/for_reduction_messages.cpp Tue Jun 17
>> 06:49:22 2014
>> @@ -0,0 +1,350 @@
>> +// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit 100 -o -
>> %s
>> +
>> +void foo() {
>> +}
>> +
>> +bool foobool(int argc) {
>> +  return argc;
>> +}
>> +
>> +struct S1; // expected-note {{declared here}} expected-note 4
>> {{forward declaration of 'S1'}}
>> +extern S1 a;
>> +class S2 {
>> +  mutable int a;
>> +  S2 &operator+=(const S2 &arg) { return (*this); }
>> +
>> +public:
>> +  S2() : a(0) {}
>> +  S2(S2 &s2) : a(s2.a) {}
>> +  static float S2s; // expected-note 2 {{predetermined as shared}}
>> +  static const float S2sc;
>> +};
>> +const float S2::S2sc = 0; // expected-note 2 {{'S2sc' defined here}}
>> +S2 b;                     // expected-note 2 {{'b' defined here}}
>> +const S2 ba[5];           // expected-note 2 {{'ba' defined here}}
>> +class S3 {
>> +  int a;
>> +
>> +public:
>> +  S3() : a(0) {}
>> +  S3(const S3 &s3) : a(s3.a) {}
>> +  S3 operator+=(const S3 &arg1) { return arg1; }
>> +};
>> +int operator+=(const S3 &arg1, const S3 &arg2) { return 5; }
>> +S3 c;               // expected-note 2 {{'c' defined here}}
>> +const S3 ca[5];     // expected-note 2 {{'ca' defined here}}
>> +extern const int f; // expected-note 4 {{'f' declared here}}
>> +class S4 {          // expected-note {{'S4' declared here}}
>> +  int a;
>> +  S4();
>> +  S4(const S4 &s4);
>> +  S4 &operator+=(const S4 &arg) { return (*this); }
>> +
>> +public:
>> +  S4(int v) : a(v) {}
>> +};
>> +S4 &operator&=(S4 &arg1, S4 &arg2) { return arg1; }
>> +class S5 {
>> +  int a;
>> +  S5() : a(0) {}
>> +  S5(const S5 &s5) : a(s5.a) {}
>> +  S5 &operator+=(const S5 &arg);
>> +
>> +public:
>> +  S5(int v) : a(v) {}
>> +};
>> +class S6 {
>> +  int a;
>> +
>> +public:
>> +  S6() : a(6) {}
>> +  operator int() { return 6; }
>> +} o; // expected-note 2 {{'o' defined here}}
>> +
>> +S3 h, k;
>> +#pragma omp threadprivate(h) // expected-note 2 {{defined as
>> threadprivate or thread local}}
>> +
>> +template <class T>       // expected-note {{declared here}}
>> +T tmain(T argc) {        // expected-note 2 {{'argc' defined here}}
>> +  const T d = T();       // expected-note 4 {{'d' defined here}}
>> +  const T da[5] = {T()}; // expected-note 2 {{'da' defined here}}
>> +  T qa[5] = {T()};
>> +  T i;
>> +  T &j = i;                // expected-note 4 {{'j' defined here}}
>> +  S3 &p = k;               // expected-note 2 {{'p' defined here}}
>> +  const T &r = da[(int)i]; // expected-note 2 {{'r' defined here}}
>> +  T &q = qa[(int)i];       // expected-note 2 {{'q' defined here}}
>> +  T fl;                    // expected-note {{'fl' defined here}}
>> +#pragma omp parallel
>> +#pragma omp for reduction // expected-error {{expected '(' after
>> 'reduction'}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction + // expected-error {{expected '(' after
>> 'reduction'}} expected-warning {{extra tokens at the end of '#pragma
>> omp for' are ignored}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction( // expected-error {{expected
>> unqualified-id}} expected-warning {{missing ':' after reduction
>> identifier - ignoring}} expected-error {{expected ')'}}
>> expected-note {{to match this '('}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(- // expected-warning {{missing ':' after
>> reduction identifier - ignoring}} expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction() // expected-error {{expected
>> unqualified-id}} expected-warning {{missing ':' after reduction
>> identifier - ignoring}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(*) // expected-warning {{missing ':' after
>> reduction identifier - ignoring}} expected-error {{expected
>> expression}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(\) // expected-error {{expected
>> unqualified-id}} expected-warning {{missing ':' after reduction
>> identifier - ignoring}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(& : argc // expected-error {{expected
>> ')'}} expected-note {{to match this '('}} expected-error {{variable
>> of type 'float' is not valid for specified reduction operation}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(| : argc, // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}} expected-error {{variable of type 'float' is not
>> valid for specified reduction operation}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(|| : argc ? i : argc) // expected-error 2
>> {{expected variable name}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(foo : argc) //expected-error {{incorrect
>> reduction identifier, expected one of '+', '-', '*', '&', '|', '^',
>> '&&', '||', 'min' or 'max'}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(&& : argc)
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(^ : T) // expected-error {{'T' does not
>> refer to a value}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(+ : a, b, c, d, f) // expected-error
>> {{reduction variable with incomplete type 'S1'}} expected-error 3
>> {{const-qualified variable cannot be reduction}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(min : a, b, c, d, f) // expected-error
>> {{reduction variable with incomplete type 'S1'}} expected-error 2
>> {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be
>> of arithmetic type}} expected-error 3 {{const-qualified variable
>> cannot be reduction}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(max : qa[1]) // expected-error 2
>> {{expected variable name}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(+ : ba) // expected-error {{a reduction
>> variable with array type 'const S2 [5]'}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(* : ca) // expected-error {{a reduction
>> variable with array type 'const S3 [5]'}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(- : da) // expected-error {{a reduction
>> variable with array type 'const int [5]'}} expected-error {{a
>> reduction variable with array type 'const float [5]'}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(^ : fl) // expected-error {{variable of
>> type 'float' is not valid for specified reduction operation}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(&& : S2::S2s) // expected-error {{shared
>> variable cannot be reduction}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(&& : S2::S2sc) // expected-error
>> {{const-qualified variable cannot be reduction}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(+ : h, k) // expected-error
>> {{threadprivate or thread local variable cannot be reduction}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(+ : o) // expected-error {{variable of
>> type 'class S6' is not valid for specified reduction operation}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for private(i), reduction(+ : j), reduction(+ : q) //
>> expected-error 4 {{argument of OpenMP clause 'reduction' must
>> reference the same object in all threads}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel private(k)
>> +#pragma omp for reduction(+ : p), reduction(+ : p) // expected-error
>> 2 {{argument of OpenMP clause 'reduction' must reference the same
>> object in all threads}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(+ : p), reduction(+ : p) // expected-error
>> 3 {{variable can appear only once in OpenMP 'reduction' clause}}
>> expected-note 3 {{previously referenced here}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(+ : r) // expected-error 2
>> {{const-qualified variable cannot be reduction}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel shared(i)
>> +#pragma omp parallel reduction(min : i)
>> +#pragma omp for reduction(max : j) // expected-error 2 {{argument of
>> OpenMP clause 'reduction' must reference the same object in all
>> threads}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel private(fl)  // expected-note 2 {{defined as
>> private}}
>> +#pragma omp for reduction(+ : fl) // expected-error 2 {{reduction
>> variable must be shared}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel reduction(* : fl) // expected-note 2 {{defined
>> as reduction}}
>> +#pragma omp for reduction(+ : fl)      // expected-error 2
>> {{reduction variable must be shared}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +
>> +  return T();
>> +}
>> +
>> +int main(int argc, char **argv) {
>> +  const int d = 5;       // expected-note 2 {{'d' defined here}}
>> +  const int da[5] = {0}; // expected-note {{'da' defined here}}
>> +  int qa[5] = {0};
>> +  S4 e(4); // expected-note {{'e' defined here}}
>> +  S5 g(5); // expected-note {{'g' defined here}}
>> +  int i;
>> +  int &j = i;           // expected-note 2 {{'j' defined here}}
>> +  S3 &p = k;            // expected-note 2 {{'p' defined here}}
>> +  const int &r = da[i]; // expected-note {{'r' defined here}}
>> +  int &q = qa[i];       // expected-note {{'q' defined here}}
>> +  float fl;             // expected-note {{'fl' defined here}}
>> +#pragma omp parallel
>> +#pragma omp for reduction // expected-error {{expected '(' after
>> 'reduction'}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction + // expected-error {{expected '(' after
>> 'reduction'}} expected-warning {{extra tokens at the end of '#pragma
>> omp for' are ignored}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction( // expected-error {{expected
>> unqualified-id}} expected-warning {{missing ':' after reduction
>> identifier - ignoring}} expected-error {{expected ')'}}
>> expected-note {{to match this '('}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(- // expected-warning {{missing ':' after
>> reduction identifier - ignoring}} expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction() // expected-error {{expected
>> unqualified-id}} expected-warning {{missing ':' after reduction
>> identifier - ignoring}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(*) // expected-warning {{missing ':' after
>> reduction identifier - ignoring}} expected-error {{expected
>> expression}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(\) // expected-error {{expected
>> unqualified-id}} expected-warning {{missing ':' after reduction
>> identifier - ignoring}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(foo : argc // expected-error {{expected
>> ')'}} expected-note {{to match this '('}} expected-error {{incorrect
>> reduction identifier, expected one of '+', '-', '*', '&', '|', '^',
>> '&&', '||', 'min' or 'max'}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(| : argc, // expected-error {{expected
>> expression}} expected-error {{expected ')'}} expected-note {{to
>> match this '('}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(|| : argc > 0 ? argv[1] : argv[2]) //
>> expected-error {{expected variable name}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(~ : argc) // expected-error {{expected
>> unqualified-id}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(&& : argc)
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(^ : S1) // expected-error {{'S1' does not
>> refer to a value}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(+ : a, b, c, d, f) // expected-error
>> {{reduction variable with incomplete type 'S1'}} expected-error 2
>> {{const-qualified variable cannot be reduction}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(min : a, b, c, d, f) // expected-error
>> {{reduction variable with incomplete type 'S1'}} expected-error 2
>> {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be
>> of arithmetic type}} expected-error 2 {{const-qualified variable
>> cannot be reduction}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(max : argv[1]) // expected-error
>> {{expected variable name}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(+ : ba) // expected-error {{a reduction
>> variable with array type 'const S2 [5]'}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(* : ca) // expected-error {{a reduction
>> variable with array type 'const S3 [5]'}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(- : da) // expected-error {{a reduction
>> variable with array type 'const int [5]'}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(^ : fl) // expected-error {{variable of
>> type 'float' is not valid for specified reduction operation}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(&& : S2::S2s) // expected-error {{shared
>> variable cannot be reduction}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(&& : S2::S2sc) // expected-error
>> {{const-qualified variable cannot be reduction}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
>> +#pragma omp parallel
>> +#pragma omp for reduction(& : e, g) // expected-error {{reduction
>> variable must have an accessible, unambiguous default constructor}}
> Again here, please separate these errors (or tell the user which is the problem).
>
>> expected-error {{variable of type 'S5' is not valid for specified
>> reduction operation}}
>> +  for (int i = 0; i < 10; ++i)
>> +    foo();
> Thanks again,
> Hal
>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140618/d4850f8c/attachment.html>


More information about the cfe-commits mailing list