diff options
author | Kelvin Li <kkwli0@gmail.com> | 2016-07-20 20:45:29 +0000 |
---|---|---|
committer | Kelvin Li <kkwli0@gmail.com> | 2016-07-20 20:45:29 +0000 |
commit | 7a77c15ec615a2b014b27307f3efb15c2687a0f9 (patch) | |
tree | 7906a8a67c2d0f1da063750466f088847ce8dcb9 /test/OpenMP/target_update_depend_messages.cpp | |
parent | 979c19b4a657680c40a06b8c4fc1efd1992e5e22 (diff) |
[OpenMP] Allow negative lower bound in array sections based on pointers
OpenMP 4.5 removed the restriction that array section lower bound must be non negative.
This change is to allow negative values for array section based on pointers.
For array section based on array type there is still a restriction: "The array section must be a subset of the original array."
Patch by David S.
Differential Revision: https://reviews.llvm.org/D22481
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276177 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/target_update_depend_messages.cpp')
-rw-r--r-- | test/OpenMP/target_update_depend_messages.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/OpenMP/target_update_depend_messages.cpp b/test/OpenMP/target_update_depend_messages.cpp index fe3325d80f..64383a0491 100644 --- a/test/OpenMP/target_update_depend_messages.cpp +++ b/test/OpenMP/target_update_depend_messages.cpp @@ -50,7 +50,7 @@ int tmain(T argc, S **argv, R *env[]) { #pragma omp target update to(z) depend(in : argv[argc: // expected-error {{expected expression}} expected-error {{expected ']'}} expected-error {{expected ')'}} expected-note {{to match this '['}} expected-note {{to match this '('}} #pragma omp target update to(z) depend(in : argv[argc:argc] // expected-error {{expected ')'}} expected-note {{to match this '('}} #pragma omp target update to(z) depend(in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}} - #pragma omp target update to(z) depend(in : argv[-1:0]) // expected-error {{section lower bound is evaluated to a negative value -1}} + #pragma omp target update to(z) depend(in : argv[-1:0]) #pragma omp target update to(z) depend(in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}} #pragma omp target update to(z) depend(in : argv[3:4:1]) // expected-error {{expected ']'}} expected-note {{to match this '['}} #pragma omp target update to(z) depend(in:a[0:1]) // expected-error {{subscripted value is not an array or pointer}} @@ -98,7 +98,7 @@ int main(int argc, char **argv, char *env[]) { #pragma omp target update to(z) depend(in : argv[argc: // expected-error {{expected expression}} expected-error {{expected ']'}} expected-error {{expected ')'}} expected-note {{to match this '['}} expected-note {{to match this '('}} #pragma omp target update to(z) depend(in : argv[argc:argc] // expected-error {{expected ')'}} expected-note {{to match this '('}} #pragma omp target update to(z) depend(in : argv[0:-1]) // expected-error {{section length is evaluated to a negative value -1}} - #pragma omp target update to(z) depend(in : argv[-1:0]) // expected-error {{section lower bound is evaluated to a negative value -1}} + #pragma omp target update to(z) depend(in : argv[-1:0]) #pragma omp target update to(z) depend(in : argv[:]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}} #pragma omp target update to(z) depend(in : argv[3:4:1]) // expected-error {{expected ']'}} expected-note {{to match this '['}} #pragma omp target update to(z) depend(in:a[0:1]) // expected-error {{subscripted value is not an array or pointer}} |