From ad9ecbab42539a722fa9688eca509912cfeb7df8 Mon Sep 17 00:00:00 2001 From: Kelvin Li Date: Wed, 20 Jul 2016 20:45:29 +0000 Subject: [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 llvm-svn: 276177 --- clang/test/OpenMP/target_map_messages.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/test/OpenMP/target_map_messages.cpp') diff --git a/clang/test/OpenMP/target_map_messages.cpp b/clang/test/OpenMP/target_map_messages.cpp index f9bb9410c49..a3b2168fedb 100644 --- a/clang/test/OpenMP/target_map_messages.cpp +++ b/clang/test/OpenMP/target_map_messages.cpp @@ -51,6 +51,10 @@ struct SA { {} #pragma omp target map(to:b,e[:]) {} + #pragma omp target map(b[-1:]) // expected-error {{array section must be a subset of the original array}} + {} + #pragma omp target map(b[:-1]) // expected-error {{section length is evaluated to a negative value -1}} + {} #pragma omp target map(always, tofrom: c,f) {} -- cgit v1.2.3