diff options
| author | Joel E. Denny <jdenny.ornl@gmail.com> | 2019-01-04 22:11:56 +0000 |
|---|---|---|
| committer | Joel E. Denny <jdenny.ornl@gmail.com> | 2019-01-04 22:11:56 +0000 |
| commit | d2649292ef268cbc4b80854659a716791ad2c0b9 (patch) | |
| tree | 976d21d2b853b7fde0517f0cb466d41839372145 /clang/test/OpenMP/for_reduction_messages.cpp | |
| parent | e6234d142911bbfa30e77386700c621f113ad9be (diff) | |
| download | bcm5719-llvm-d2649292ef268cbc4b80854659a716791ad2c0b9.tar.gz bcm5719-llvm-d2649292ef268cbc4b80854659a716791ad2c0b9.zip | |
[OpenMP] Refactor const restriction for reductions
As discussed in D56113, this patch refactors the implementation of the
const restriction for reductions to reuse a function introduced by
D56113. A side effect is that diagnostics sometimes now say
"variable" instead of "list item" when a list item is a variable.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D56298
llvm-svn: 350440
Diffstat (limited to 'clang/test/OpenMP/for_reduction_messages.cpp')
| -rw-r--r-- | clang/test/OpenMP/for_reduction_messages.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/clang/test/OpenMP/for_reduction_messages.cpp b/clang/test/OpenMP/for_reduction_messages.cpp index 520097de668..f575ee463d3 100644 --- a/clang/test/OpenMP/for_reduction_messages.cpp +++ b/clang/test/OpenMP/for_reduction_messages.cpp @@ -146,11 +146,11 @@ T tmain(T argc) { for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified list item cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}} +#pragma omp for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 3 {{const-qualified variable cannot be reduction}} expected-error 2 {{'operator+' is a private member of 'S2'}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{arguments of OpenMP clause 'reduction' for 'min' or 'max' must be of arithmetic type}} expected-error 3 {{const-qualified list item cannot be reduction}} +#pragma omp for reduction(min : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 4 {{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 @@ -158,15 +158,15 @@ T tmain(T argc) { for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(+ : ba) // expected-error {{const-qualified list item cannot be reduction}} +#pragma omp for reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(* : ca) // expected-error {{const-qualified list item cannot be reduction}} +#pragma omp for reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(- : da) // expected-error {{const-qualified list item cannot be reduction}} expected-error {{const-qualified list item cannot be reduction}} +#pragma omp for reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}} expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel @@ -178,7 +178,7 @@ T tmain(T argc) { for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(&& : S2::S2sc) // expected-error {{const-qualified list item cannot be reduction}} +#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 @@ -202,7 +202,7 @@ T tmain(T argc) { for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(+ : r) // expected-error 2 {{const-qualified list item cannot be reduction}} +#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) @@ -303,11 +303,11 @@ int main(int argc, char **argv) { for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified list item cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}} +#pragma omp for reduction(+ : a, b, c, d, f) // expected-error {{a reduction list item with incomplete type 'S1'}} expected-error 2 {{const-qualified variable cannot be reduction}} expected-error {{'operator+' is a private member of 'S2'}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(min : a, b, c, d, f) // expected-error {{a reduction list item 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 list item cannot be reduction}} +#pragma omp for reduction(min : a, b, c, d, f) // expected-error {{a reduction list item 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 @@ -315,15 +315,15 @@ int main(int argc, char **argv) { for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(+ : ba) // expected-error {{const-qualified list item cannot be reduction}} +#pragma omp for reduction(+ : ba) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(* : ca) // expected-error {{const-qualified list item cannot be reduction}} +#pragma omp for reduction(* : ca) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(- : da) // expected-error {{const-qualified list item cannot be reduction}} +#pragma omp for reduction(- : da) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel @@ -335,7 +335,7 @@ int main(int argc, char **argv) { for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(&& : S2::S2sc) // expected-error {{const-qualified list item cannot be reduction}} +#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 @@ -367,7 +367,7 @@ int main(int argc, char **argv) { for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel -#pragma omp for reduction(+ : r) // expected-error {{const-qualified list item cannot be reduction}} +#pragma omp for reduction(+ : r) // expected-error {{const-qualified variable cannot be reduction}} for (int i = 0; i < 10; ++i) foo(); #pragma omp parallel shared(i) |

