diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2019-04-25 16:21:13 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-04-25 16:21:13 +0000 |
commit | 95b64a39967af2818c21254a8e1992a0e0e07c47 (patch) | |
tree | d55831c1985713a343df7a6dab9c193eeb2739c1 /test | |
parent | 9981cdc9924fb8b614e60aef543372a47d12699e (diff) | |
download | clang-95b64a39967af2818c21254a8e1992a0e0e07c47.tar.gz |
[OPENMP] Improved check for the linear dependency in the non-rectangular
loop nests.
Added a checks that the initializer/condition expressions depend only
only of the single previous loop iteration variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359200 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/OpenMP/for_loop_messages.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/test/OpenMP/for_loop_messages.cpp b/test/OpenMP/for_loop_messages.cpp index 01c96add28..f3fba6781b 100644 --- a/test/OpenMP/for_loop_messages.cpp +++ b/test/OpenMP/for_loop_messages.cpp @@ -293,6 +293,12 @@ int test_iteration_spaces() { for (ii = ii * 10 + 25; ii < ii / ii - 23; ii += 1) c[ii] = a[ii]; +// expected-error@+3 {{expected loop invariant expression or '<invariant1> * ii + <invariant2>' kind of expression}} +#pragma omp for collapse(2) + for (ii = 10 + 25; ii < 1000; ii += 1) + for (kk = ii * 10 + 25; kk < ii / ii - 23; kk += 1) + ; + #pragma omp parallel // expected-note@+2 {{defined as firstprivate}} // expected-error@+2 {{loop iteration variable in the associated loop of 'omp for' directive may not be firstprivate, predetermined as private}} @@ -603,7 +609,7 @@ int test_with_random_access_iterator() { template <typename IT, int ST> class TC { - int ii; + int ii, iii; public: int dotest_lt(IT begin, IT end) { #pragma omp parallel @@ -614,6 +620,14 @@ public: ; #pragma omp parallel +// expected-error@+4 2 {{expected loop invariant expression or '<invariant1> * ii + <invariant2>' kind of expression}} +// expected-error@+3 {{expected loop invariant expression or '<invariant1> * TC::ii + <invariant2>' kind of expression}} +#pragma omp for collapse(2) + for (ii = 10 + 25; ii < 1000; ii += 1) + for (iii = ii * 10 + 25; iii < ii / ii - 23; iii += 1) + ; + +#pragma omp parallel // expected-note@+3 {{loop step is expected to be positive due to this condition}} // expected-error@+2 {{increment expression must cause 'I' to increase on each iteration of OpenMP for loop}} #pragma omp for |