diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2017-11-29 21:31:48 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-11-29 21:31:48 +0000 |
commit | 89c18a7f70e267b05db6ae038d36a56e2b2b8775 (patch) | |
tree | ec76cb0c01a6c4c6d8bad12a07514f6b40a3dbc8 /test/OpenMP/distribute_parallel_for_simd_ast_print.cpp | |
parent | 709440ae21bce19fcde67f4812721fab6c509ece (diff) |
[OPENMP] Allow only loop control variables in distribute simd
directives.
According to the OpenMP standard, only loop control variables can be
used in linear clauses of distribute-based simd directives.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319362 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/OpenMP/distribute_parallel_for_simd_ast_print.cpp')
-rw-r--r-- | test/OpenMP/distribute_parallel_for_simd_ast_print.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp b/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp index 6ed3f21922..464acbe19c 100644 --- a/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp +++ b/test/OpenMP/distribute_parallel_for_simd_ast_print.cpp @@ -28,17 +28,18 @@ public: ++this->a.a; } S7 &operator=(S7 &s) { + int k; #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd private(a) private(this->a) - for (int k = 0; k < s.a.a; ++k) +#pragma omp distribute parallel for simd private(a) private(this->a) linear(k) + for (k = 0; k < s.a.a; ++k) ++s.a.a; return *this; } }; // CHECK: #pragma omp distribute parallel for simd private(this->a) private(this->a) private(T::a) -// CHECK: #pragma omp distribute parallel for simd private(this->a) private(this->a) +// CHECK: #pragma omp distribute parallel for simd private(this->a) private(this->a) linear(k) // CHECK: #pragma omp distribute parallel for simd private(this->a) private(this->a) private(this->S::a) class S8 : public S7<S> { @@ -135,14 +136,15 @@ int main(int argc, char **argv) { // CHECK-NEXT: for (int j = 0; j < 10; ++j) // CHECK-NEXT: a++; + int i; #pragma omp target #pragma omp teams -#pragma omp distribute parallel for simd aligned(x:8) linear(h:2) safelen(8) simdlen(8) - for (int i = 0; i < 100; i++) +#pragma omp distribute parallel for simd aligned(x:8) linear(i:2) safelen(8) simdlen(8) + for (i = 0; i < 100; i++) for (int j = 0; j < 200; j++) a += h + x[j]; - // CHECK: #pragma omp distribute parallel for simd aligned(x: 8) linear(h: 2) safelen(8) simdlen(8) - // CHECK-NEXT: for (int i = 0; i < 100; i++) + // CHECK: #pragma omp distribute parallel for simd aligned(x: 8) linear(i: 2) safelen(8) simdlen(8) + // CHECK-NEXT: for (i = 0; i < 100; i++) // CHECK-NEXT: for (int j = 0; j < 200; j++) // CHECK-NEXT: a += h + x[j]; |