diff options
author | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2013-12-22 00:07:40 +0000 |
commit | 952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch) | |
tree | df8df0b0067b381eab470a3b8f28d14a552a6340 /test/OpenMP | |
parent | ea266cad53e3d49771fa38103913d3ec7a166694 (diff) | |
download | FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz |
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/OpenMP')
-rw-r--r-- | test/OpenMP/openmp_common.c | 2 | ||||
-rw-r--r-- | test/OpenMP/parallel_ast_print.cpp | 60 | ||||
-rw-r--r-- | test/OpenMP/parallel_default_messages.cpp | 21 | ||||
-rw-r--r-- | test/OpenMP/parallel_firstprivate_messages.cpp | 82 | ||||
-rw-r--r-- | test/OpenMP/parallel_messages.cpp | 53 | ||||
-rw-r--r-- | test/OpenMP/parallel_private_messages.cpp | 81 | ||||
-rw-r--r-- | test/OpenMP/parallel_shared_messages.cpp | 83 | ||||
-rw-r--r-- | test/OpenMP/predefined_macro.c | 1 | ||||
-rw-r--r-- | test/OpenMP/threadprivate_ast_print.cpp | 20 | ||||
-rw-r--r-- | test/OpenMP/threadprivate_messages.cpp | 46 |
10 files changed, 425 insertions, 24 deletions
diff --git a/test/OpenMP/openmp_common.c b/test/OpenMP/openmp_common.c index ca5d89a..3765f4c 100644 --- a/test/OpenMP/openmp_common.c +++ b/test/OpenMP/openmp_common.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s #pragma omp // expected-error {{expected an OpenMP directive}} #pragma omp unknown_directive // expected-error {{expected an OpenMP directive}} diff --git a/test/OpenMP/parallel_ast_print.cpp b/test/OpenMP/parallel_ast_print.cpp new file mode 100644 index 0000000..f2fd2f7 --- /dev/null +++ b/test/OpenMP/parallel_ast_print.cpp @@ -0,0 +1,60 @@ +// RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print | FileCheck %s +// expected-no-diagnostics + +#ifndef HEADER +#define HEADER + +void foo() {} + + +template <typename T> +T tmain(T argc, T *argv) { + T b = argc, c, d, e, f, g; + static T a; +#pragma omp parallel + a=2; +#pragma omp parallel default(none), private(argc,b) firstprivate(argv) shared (d) + foo(); + return 0; +} +// CHECK: template <typename T = int> int tmain(int argc, int *argv) { +// CHECK-NEXT: int b = argc, c, d, e, f, g; +// CHECK-NEXT: static int a; +// CHECK-NEXT: #pragma omp parallel +// CHECK-NEXT: a = 2; +// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d) +// CHECK-NEXT: foo() +// CHECK: template <typename T = float> float tmain(float argc, float *argv) { +// CHECK-NEXT: float b = argc, c, d, e, f, g; +// CHECK-NEXT: static float a; +// CHECK-NEXT: #pragma omp parallel +// CHECK-NEXT: a = 2; +// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d) +// CHECK-NEXT: foo() +// CHECK: template <typename T> T tmain(T argc, T *argv) { +// CHECK-NEXT: T b = argc, c, d, e, f, g; +// CHECK-NEXT: static T a; +// CHECK-NEXT: #pragma omp parallel +// CHECK-NEXT: a = 2; +// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d) +// CHECK-NEXT: foo() + +int main (int argc, char **argv) { + float x; + int b = argc, c, d, e, f, g; + static int a; +// CHECK: static int a; +#pragma omp parallel +// CHECK-NEXT: #pragma omp parallel + a=2; +// CHECK-NEXT: a = 2; +#pragma omp parallel default(none), private(argc,b) firstprivate(argv) +// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) + foo(); +// CHECK-NEXT: foo(); + return tmain(b, &b) + tmain(x, &x); +} + +#endif diff --git a/test/OpenMP/parallel_default_messages.cpp b/test/OpenMP/parallel_default_messages.cpp new file mode 100644 index 0000000..cbc6a73 --- /dev/null +++ b/test/OpenMP/parallel_default_messages.cpp @@ -0,0 +1,21 @@ +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s + +void foo(); + +int main(int argc, char **argv) { + #pragma omp parallel default // expected-error {{expected '(' after 'default'}} + #pragma omp parallel default ( // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel default () // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} + #pragma omp parallel default (none // expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel default (shared), default(shared) // expected-error {{directive '#pragma omp parallel' cannot contain more than one 'default' clause}} + #pragma omp parallel default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}} + foo(); + + #pragma omp parallel default(none) + ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} + + #pragma omp parallel default(none) + #pragma omp parallel default(shared) + ++argc; + return 0; +} diff --git a/test/OpenMP/parallel_firstprivate_messages.cpp b/test/OpenMP/parallel_firstprivate_messages.cpp new file mode 100644 index 0000000..780059e --- /dev/null +++ b/test/OpenMP/parallel_firstprivate_messages.cpp @@ -0,0 +1,82 @@ +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s + +void foo() { +} + +bool foobool(int argc) { + return argc; +} + +struct S1; // expected-note {{declared here}} expected-note{{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; +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 {{'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) {} + S5(const S5 &s5):a(s5.a) { } +public: + S5(int v):a(v) { } +}; + +S3 h; +#pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}} + +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 {{'g' defined here}} + int i; + int &j = i; // expected-note {{'j' defined here}} + #pragma omp parallel firstprivate // expected-error {{expected '(' after 'firstprivate'}} + #pragma omp parallel firstprivate ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel firstprivate () // expected-error {{expected expression}} + #pragma omp parallel firstprivate (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel firstprivate (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel firstprivate (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} + #pragma omp parallel firstprivate (argc) + #pragma omp parallel firstprivate (S1) // expected-error {{'S1' does not refer to a value}} + #pragma omp parallel firstprivate (a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} + #pragma omp parallel firstprivate (argv[1]) // expected-error {{expected variable name}} + #pragma omp parallel firstprivate(ba) + #pragma omp parallel firstprivate(ca) + #pragma omp parallel firstprivate(da) + #pragma omp parallel firstprivate(S2::S2s) + #pragma omp parallel firstprivate(S2::S2sc) + #pragma omp parallel firstprivate(e, g) // expected-error 2 {{firstprivate variable must have an accessible, unambiguous copy constructor}} + #pragma omp parallel firstprivate(h) // expected-error {{threadprivate or thread local variable cannot be firstprivate}} + #pragma omp parallel private(i), firstprivate(i) // expected-error {{private variable cannot be firstprivate}} expected-note{{defined as private}} + foo(); + #pragma omp parallel shared(i) + #pragma omp parallel firstprivate(i) + #pragma omp parallel firstprivate(j) // expected-error {{arguments of OpenMP clause 'firstprivate' cannot be of reference type}} + foo(); + + return 0; +} diff --git a/test/OpenMP/parallel_messages.cpp b/test/OpenMP/parallel_messages.cpp new file mode 100644 index 0000000..d991ccf --- /dev/null +++ b/test/OpenMP/parallel_messages.cpp @@ -0,0 +1,53 @@ +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -std=c++11 -o - %s + +void foo() { +} + +#pragma omp parallel // expected-error {{unexpected OpenMP directive '#pragma omp parallel'}} + +int main(int argc, char **argv) { + #pragma omp parallel + #pragma omp parallel unknown() // expected-warning {{extra tokens at the end of '#pragma omp parallel' are ignored}} + foo(); + L1: + foo(); + #pragma omp parallel + ; + #pragma omp parallel + { + goto L1; // expected-error {{use of undeclared label 'L1'}} + argc++; + } + + for (int i = 0; i < 10; ++i) { + switch(argc) { + case (0): + #pragma omp parallel + { + foo(); + break; // expected-error {{'break' statement not in loop or switch statement}} + continue; // expected-error {{'continue' statement not in loop statement}} + } + default: + break; + } + } + #pragma omp parallel default(none) + ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} + + goto L2; // expected-error {{use of undeclared label 'L2'}} + #pragma omp parallel + L2: + foo(); + #pragma omp parallel + { + return 1; // expected-error {{cannot return from OpenMP region}} + } + + [[]] // expected-error {{an attribute list cannot appear here}} + #pragma omp parallel + for (int n = 0; n < 100; ++n) {} + + return 0; +} + diff --git a/test/OpenMP/parallel_private_messages.cpp b/test/OpenMP/parallel_private_messages.cpp new file mode 100644 index 0000000..2037d56 --- /dev/null +++ b/test/OpenMP/parallel_private_messages.cpp @@ -0,0 +1,81 @@ +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s + +void foo() { +} + +bool foobool(int argc) { + return argc; +} + +struct S1; // expected-note {{declared here}} expected-note{{forward declaration of 'S1'}} +extern S1 a; +class S2 { + mutable int a; +public: + S2():a(0) { } + static float S2s; // expected-note {{predetermined as shared}} +}; +const S2 b; +const S2 ba[5]; +class S3 { + int a; +public: + S3():a(0) { } +}; +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 {{'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) { } +}; + +int threadvar; +#pragma omp threadprivate(threadvar) // expected-note {{defined as threadprivate or thread local}} + +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}} + int i; + int &j = i; // expected-note {{'j' defined here}} + #pragma omp parallel private // expected-error {{expected '(' after 'private'}} + #pragma omp parallel private ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel private () // expected-error {{expected expression}} + #pragma omp parallel private (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel private (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel private (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} + #pragma omp parallel private (argc argv) // expected-error {{expected ',' or ')' in 'private' clause}} + #pragma omp parallel private (S1) // expected-error {{'S1' does not refer to a value}} + #pragma omp parallel private (a, b, c, d, f) // expected-error {{a private variable with incomplete type 'S1'}} expected-error 3 {{shared variable cannot be private}} + #pragma omp parallel private (argv[1]) // expected-error {{expected variable name}} + #pragma omp parallel private(ba) + #pragma omp parallel private(ca) // expected-error {{shared variable cannot be private}} + #pragma omp parallel private(da) // expected-error {{shared variable cannot be private}} + #pragma omp parallel private(S2::S2s) // expected-error {{shared variable cannot be private}} + #pragma omp parallel private(e, g) // expected-error 2 {{private variable must have an accessible, unambiguous default constructor}} + #pragma omp parallel private(threadvar) // expected-error {{threadprivate or thread local variable cannot be private}} + #pragma omp parallel shared(i), private(i) // expected-error {{shared variable cannot be private}} expected-note {{defined as shared}} + foo(); + #pragma omp parallel firstprivate(i) private(i) // expected-error {{firstprivate variable cannot be private}} expected-note {{defined as firstprivate}} + foo(); + #pragma omp parallel private(i) + #pragma omp parallel private(j) // expected-error {{arguments of OpenMP clause 'private' cannot be of reference type 'int &'}} + foo(); + #pragma omp parallel firstprivate(i) + for (int k = 0; k < 10; ++k) { + #pragma omp parallel private(i) + foo(); + } + + return 0; +} diff --git a/test/OpenMP/parallel_shared_messages.cpp b/test/OpenMP/parallel_shared_messages.cpp new file mode 100644 index 0000000..211d392f --- /dev/null +++ b/test/OpenMP/parallel_shared_messages.cpp @@ -0,0 +1,83 @@ +// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s + +void foo() { +} + +bool foobool(int argc) { + return argc; +} + +struct S1; // expected-note {{declared here}} +extern S1 a; +class S2 { + mutable int a; +public: + S2():a(0) { } + S2(S2 &s2):a(s2.a) { } +}; +const S2 b; +const S2 ba[5]; +class S3 { + int a; +public: + S3():a(0) { } + S3(S3 &s3):a(s3.a) { } +}; +const S3 c; +const S3 ca[5]; +extern const int f; +class S4 { + int a; + S4(); + S4(const S4 &s4); +public: + S4(int v):a(v) { } +}; +class S5 { + int a; + S5():a(0) {} + S5(const S5 &s5):a(s5.a) { } +public: + S5(int v):a(v) { } +}; + +S3 h; +#pragma omp threadprivate(h) // expected-note {{defined as threadprivate or thread local}} + +int main(int argc, char **argv) { + const int d = 5; + const int da[5] = { 0 }; + S4 e(4); + S5 g(5); + int i; + int &j = i; + #pragma omp parallel shared // expected-error {{expected '(' after 'shared'}} + #pragma omp parallel shared ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel shared () // expected-error {{expected expression}} + #pragma omp parallel shared (argc // expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel shared (argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel shared (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} + #pragma omp parallel shared (argc) + #pragma omp parallel shared (S1) // expected-error {{'S1' does not refer to a value}} + #pragma omp parallel shared (a, b, c, d, f) + #pragma omp parallel shared (argv[1]) // expected-error {{expected variable name}} + #pragma omp parallel shared(ba) + #pragma omp parallel shared(ca) + #pragma omp parallel shared(da) + #pragma omp parallel shared(e, g) + #pragma omp parallel shared(h) // expected-error {{threadprivate or thread local variable cannot be shared}} + #pragma omp parallel private(i), shared(i) // expected-error {{private variable cannot be shared}} expected-note {{defined as private}} + foo(); + #pragma omp parallel firstprivate(i), shared(i) // expected-error {{firstprivate variable cannot be shared}} expected-note {{defined as firstprivate}} + foo(); + #pragma omp parallel private(i) + #pragma omp parallel shared(i) + #pragma omp parallel shared(j) + foo(); + #pragma omp parallel firstprivate(i) + #pragma omp parallel shared(i) + #pragma omp parallel shared(j) + foo(); + + return 0; +} diff --git a/test/OpenMP/predefined_macro.c b/test/OpenMP/predefined_macro.c index cf6c0cc..3a81186 100644 --- a/test/OpenMP/predefined_macro.c +++ b/test/OpenMP/predefined_macro.c @@ -31,4 +31,3 @@ #error "_OPENMP macro is defined without -fopenmp option" #endif // _OPENMP #endif // FOPENMP - diff --git a/test/OpenMP/threadprivate_ast_print.cpp b/test/OpenMP/threadprivate_ast_print.cpp index deb829e..72bf6f4 100644 --- a/test/OpenMP/threadprivate_ast_print.cpp +++ b/test/OpenMP/threadprivate_ast_print.cpp @@ -1,5 +1,12 @@ // RUN: %clang_cc1 -verify -fopenmp -ast-print %s | FileCheck %s +// RUN: %clang_cc1 -fopenmp -x c++ -std=c++11 -emit-pch -o %t %s +// RUN: %clang_cc1 -fopenmp -std=c++11 -include-pch %t -fsyntax-only -verify %s -ast-print // expected-no-diagnostics +// FIXME: This test has been crashing since r186647. +// REQUIRES: disabled + +#ifndef HEADER +#define HEADER struct St{ int a; @@ -10,7 +17,7 @@ struct St1{ static int b; // CHECK: static int b; #pragma omp threadprivate(b) -// CHECK-NEXT: #pragma omp threadprivate(b) +// CHECK-NEXT: #pragma omp threadprivate(St1::b) } d; int a, b; @@ -33,6 +40,15 @@ template <class T> T foo() { //CHECK-NEXT: static T v; //CHECK-NEXT: #pragma omp threadprivate(v) +namespace ns{ + int a; +} +// CHECK: namespace ns { +// CHECK-NEXT: int a; +// CHECK-NEXT: } +#pragma omp threadprivate(ns::a) +// CHECK-NEXT: #pragma omp threadprivate(ns::a) + int main () { static int a; // CHECK: static int a; @@ -41,3 +57,5 @@ int main () { a=2; return (foo<int>()); } + +#endif diff --git a/test/OpenMP/threadprivate_messages.cpp b/test/OpenMP/threadprivate_messages.cpp index 0c448b2..4858549 100644 --- a/test/OpenMP/threadprivate_messages.cpp +++ b/test/OpenMP/threadprivate_messages.cpp @@ -1,8 +1,8 @@ // RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 %s #pragma omp threadprivate // expected-error {{expected '(' after 'threadprivate'}} -#pragma omp threadprivate( // expected-error {{expected unqualified-id}} -#pragma omp threadprivate() // expected-error {{expected unqualified-id}} +#pragma omp threadprivate( // expected-error {{expected identifier}} expected-error {{expected ')'}} expected-note {{to match this '('}} +#pragma omp threadprivate() // expected-error {{expected identifier}} #pragma omp threadprivate(1) // expected-error {{expected unqualified-id}} struct CompleteSt{ int a; @@ -11,29 +11,29 @@ struct CompleteSt{ struct CompleteSt1{ #pragma omp threadprivate(1) // expected-error {{expected unqualified-id}} int a; -} d; // expected-note {{forward declaration of 'd'}} +} d; // expected-note {{'d' defined here}} -int a; // expected-note {{forward declaration of 'a'}} +int a; // expected-note {{'a' defined here}} #pragma omp threadprivate(a) #pragma omp threadprivate(u) // expected-error {{use of undeclared identifier 'u'}} #pragma omp threadprivate(d, a) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'a'}} int foo() { // expected-note {{declared here}} static int l; -#pragma omp threadprivate(l)) // expected-warning {{extra tokens at end of '#pragma omp threadprivate' are ignored}} +#pragma omp threadprivate(l)) // expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}} return (a); } #pragma omp threadprivate a // expected-error {{expected '(' after 'threadprivate'}} #pragma omp threadprivate(d // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{'#pragma omp threadprivate' must precede all references to variable 'd'}} -#pragma omp threadprivate(d)) +#pragma omp threadprivate(d)) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'd'}} expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}} int x, y; -#pragma omp threadprivate(x)) // expected-warning {{extra tokens at end of '#pragma omp threadprivate' are ignored}} -#pragma omp threadprivate(y)), // expected-warning {{extra tokens at end of '#pragma omp threadprivate' are ignored}} +#pragma omp threadprivate(x)) // expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}} +#pragma omp threadprivate(y)), // expected-warning {{extra tokens at the end of '#pragma omp threadprivate' are ignored}} #pragma omp threadprivate(a,d) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'a'}} expected-error {{'#pragma omp threadprivate' must precede all references to variable 'd'}} -#pragma omp threadprivate(d.a) // expected-error {{expected unqualified-id}} +#pragma omp threadprivate(d.a) // expected-error {{expected identifier}} #pragma omp threadprivate((float)a) // expected-error {{expected unqualified-id}} -int foa; +int foa; // expected-note {{'foa' declared here}} #pragma omp threadprivate(faa) // expected-error {{use of undeclared identifier 'faa'; did you mean 'foa'?}} #pragma omp threadprivate(foo) // expected-error {{'foo' is not a global variable, static local variable or static data member}} #pragma omp threadprivate (int a=2) // expected-error {{expected unqualified-id}} @@ -41,22 +41,22 @@ int foa; struct IncompleteSt; // expected-note {{forward declaration of 'IncompleteSt'}} extern IncompleteSt e; -#pragma omp threadprivate (e) // expected-error {{a threadprivate variable must not have incomplete type 'IncompleteSt'}} +#pragma omp threadprivate (e) // expected-error {{threadprivate variable with incomplete type 'IncompleteSt'}} -int &f = a; // expected-note {{forward declaration of 'f'}} +int &f = a; // expected-note {{'f' defined here}} #pragma omp threadprivate (f) // expected-error {{arguments of '#pragma omp threadprivate' cannot be of reference type 'int &'}} class Class { private: int a; // expected-note {{declared here}} - static int b; + static int b; // expected-note {{'b' declared here}} Class() : a(0){} public: Class (int aaa) : a(aaa) {} #pragma omp threadprivate (b, a) // expected-error {{'a' is not a global variable, static local variable or static data member}} } g(10); #pragma omp threadprivate (b) // expected-error {{use of undeclared identifier 'b'}} -#pragma omp threadprivate (Class::b) // expected-error {{expected unqualified-id}} +#pragma omp threadprivate (Class::b) // expected-error {{'#pragma omp threadprivate' must appear in the scope of the 'Class::b' variable declaration}} #pragma omp threadprivate (g) namespace ns { @@ -64,8 +64,8 @@ namespace ns { #pragma omp threadprivate (m) } #pragma omp threadprivate (m) // expected-error {{use of undeclared identifier 'm'}} -#pragma omp threadprivate (ns::m) // expected-error {{expected unqualified-id}} -#pragma omp threadprivate (ns:m) // expected-error {{expected unqualified-id}} +#pragma omp threadprivate (ns::m) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'ns::m'}} +#pragma omp threadprivate (ns:m) // expected-error {{unexpected ':' in nested name specifier; did you mean '::'?}} expected-error {{'#pragma omp threadprivate' must precede all references to variable 'ns::m'}} const int h = 12; const volatile int i = 10; @@ -84,26 +84,30 @@ class TempClass { }; #pragma omp threadprivate (s) // expected-error {{use of undeclared identifier 's'}} -static __thread int t; // expected-note {{forward declaration of 't'}} +static __thread int t; // expected-note {{'t' defined here}} #pragma omp threadprivate (t) // expected-error {{variable 't' cannot be threadprivate because it is thread-local}} int o; // expected-note {{candidate found by name lookup is 'o'}} +#pragma omp threadprivate (o) namespace { int o; // expected-note {{candidate found by name lookup is '<anonymous namespace>::o'}} +#pragma omp threadprivate (o) +#pragma omp threadprivate (o) // expected-error {{'#pragma omp threadprivate' must precede all references to variable '<anonymous namespace>::o'}} } #pragma omp threadprivate (o) // expected-error {{reference to 'o' is ambiguous}} +#pragma omp threadprivate (::o) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'o'}} -int main(int argc, char **argv) { // expected-note {{forward declaration of 'argc'}} +int main(int argc, char **argv) { // expected-note {{'argc' defined here}} - int x, y = argc; // expected-note {{forward declaration of 'y'}} + int x, y = argc; // expected-note {{'y' defined here}} static double d1; static double d2; - static double d3; // expected-note {{forward declaration of 'd3'}} + static double d3; // expected-note {{'d3' defined here}} d.a = a; d2++; ; -#pragma omp threadprivate(argc+y) // expected-error {{expected unqualified-id}} +#pragma omp threadprivate(argc+y) // expected-error {{expected identifier}} #pragma omp threadprivate(argc,y) // expected-error 2 {{arguments of '#pragma omp threadprivate' must have static storage duration}} #pragma omp threadprivate(d2) // expected-error {{'#pragma omp threadprivate' must precede all references to variable 'd2'}} #pragma omp threadprivate(d1) |