summaryrefslogtreecommitdiffstats
path: root/test/OpenMP/target_parallel_for_simd_map_messages.cpp
diff options
context:
space:
mode:
authorKelvin Li <kkwli0@gmail.com>2016-07-20 20:45:29 +0000
committerKelvin Li <kkwli0@gmail.com>2016-07-20 20:45:29 +0000
commit7a77c15ec615a2b014b27307f3efb15c2687a0f9 (patch)
tree7906a8a67c2d0f1da063750466f088847ce8dcb9 /test/OpenMP/target_parallel_for_simd_map_messages.cpp
parent979c19b4a657680c40a06b8c4fc1efd1992e5e22 (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_parallel_for_simd_map_messages.cpp')
-rw-r--r--test/OpenMP/target_parallel_for_simd_map_messages.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/OpenMP/target_parallel_for_simd_map_messages.cpp b/test/OpenMP/target_parallel_for_simd_map_messages.cpp
index 93f0be81e3..195b39c595 100644
--- a/test/OpenMP/target_parallel_for_simd_map_messages.cpp
+++ b/test/OpenMP/target_parallel_for_simd_map_messages.cpp
@@ -80,6 +80,10 @@ T tmain(T argc) {
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd map(x: y) // expected-error {{incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'}}
for (i = 0; i < argc; ++i) foo();
+#pragma omp target parallel for simd map(l[-1:]) // expected-error 2 {{array section must be a subset of the original array}}
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target parallel for simd map(l[:-1]) // expected-error 2 {{section length is evaluated to a negative value -1}}
+ for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd map(x)
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd map(tofrom: t[:I])
@@ -196,6 +200,10 @@ int main(int argc, char **argv) {
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd map(x: y) // expected-error {{incorrect map type, expected one of 'to', 'from', 'tofrom', 'alloc', 'release', or 'delete'}}
for (i = 0; i < argc; ++i) foo();
+#pragma omp target parallel map(l[-1:]) // expected-error {{array section must be a subset of the original array}}
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target parallel map(l[:-1]) // expected-error {{section length is evaluated to a negative value -1}}
+ for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd map(x)
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd map(to: x)