Changeset View
Changeset View
Standalone View
Standalone View
test/OpenMP/task_firstprivate_messages.cpp
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | |||||
66 | 66 | | |||
67 | int main(int argc, char **argv) { | 67 | int main(int argc, char **argv) { | ||
68 | const int d = 5; | 68 | const int d = 5; | ||
69 | const int da[5] = {0}; | 69 | const int da[5] = {0}; | ||
70 | S4 e(4); | 70 | S4 e(4); | ||
71 | S5 g(5); | 71 | S5 g(5); | ||
72 | int i; | 72 | int i; | ||
73 | int &j = i; | 73 | int &j = i; | ||
74 | static int m; | ||||
74 | #pragma omp task firstprivate // expected-error {{expected '(' after 'firstprivate'}} | 75 | #pragma omp task firstprivate // expected-error {{expected '(' after 'firstprivate'}} | ||
75 | #pragma omp task firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} | 76 | #pragma omp task firstprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} | ||
76 | #pragma omp task firstprivate() // expected-error {{expected expression}} | 77 | #pragma omp task firstprivate() // expected-error {{expected expression}} | ||
77 | #pragma omp task firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}} | 78 | #pragma omp task firstprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}} | ||
78 | #pragma omp task firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} | 79 | #pragma omp task firstprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} | ||
79 | #pragma omp task firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} | 80 | #pragma omp task firstprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}} | ||
80 | #pragma omp task firstprivate(argc) | 81 | #pragma omp task firstprivate(argc) | ||
81 | #pragma omp task firstprivate(S1) // expected-error {{'S1' does not refer to a value}} | 82 | #pragma omp task firstprivate(S1) // expected-error {{'S1' does not refer to a value}} | ||
82 | #pragma omp task firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} | 83 | #pragma omp task firstprivate(a, b, c, d, f) // expected-error {{firstprivate variable with incomplete type 'S1'}} | ||
83 | #pragma omp task firstprivate(argv[1]) // expected-error {{expected variable name}} | 84 | #pragma omp task firstprivate(argv[1]) // expected-error {{expected variable name}} | ||
84 | #pragma omp task firstprivate(ba) | 85 | #pragma omp task firstprivate(ba) | ||
85 | #pragma omp task firstprivate(ca) | 86 | #pragma omp task firstprivate(ca) | ||
86 | #pragma omp task firstprivate(da) | 87 | #pragma omp task firstprivate(da) | ||
87 | #pragma omp task firstprivate(S2::S2s) | 88 | #pragma omp task firstprivate(S2::S2s) | ||
88 | #pragma omp task firstprivate(S2::S2sc) | 89 | #pragma omp task firstprivate(S2::S2sc) | ||
89 | #pragma omp task firstprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}} expected-error 2 {{calling a private constructor of class 'S5'}} | 90 | #pragma omp task firstprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}} expected-error 2 {{calling a private constructor of class 'S5'}} | ||
90 | #pragma omp task firstprivate(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be firstprivate}} | 91 | #pragma omp task firstprivate(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be firstprivate}} | ||
91 | #pragma omp task private(i), firstprivate(i) // expected-error {{private variable cannot be firstprivate}} expected-note{{defined as private}} | 92 | #pragma omp task private(i), firstprivate(i) // expected-error {{private variable cannot be firstprivate}} expected-note{{defined as private}} | ||
92 | foo(); | 93 | foo(); | ||
93 | #pragma omp task shared(i) | 94 | #pragma omp task shared(i) | ||
94 | #pragma omp task firstprivate(i) | 95 | #pragma omp task firstprivate(i) | ||
95 | #pragma omp task firstprivate(j) | 96 | #pragma omp task firstprivate(j) | ||
97 | #pragma omp task firstprivate(m) // OK | ||||
96 | foo(); | 98 | foo(); | ||
97 | 99 | | |||
98 | return 0; | 100 | return 0; | ||
99 | } | 101 | } |