diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2016-03-29 10:59:56 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2016-03-29 10:59:56 +0000 |
| commit | 1efd166af693349463a520257d4a536f10dddc9e (patch) | |
| tree | b050438d5dcd3550957d2e42acf82a38a3561e44 /clang/test/OpenMP/simd_ast_print.cpp | |
| parent | 1796c2e37bcc83307aba904110468310f248fe71 (diff) | |
| download | bcm5719-llvm-1efd166af693349463a520257d4a536f10dddc9e.tar.gz bcm5719-llvm-1efd166af693349463a520257d4a536f10dddc9e.zip | |
[OPENMP 4.5] Allow data members in 'aligned' clause.
OpenMP 4.5 allows privatization of data members OpenMP clauses. Patch
adds support for data members in 'aligned' clause.
llvm-svn: 264715
Diffstat (limited to 'clang/test/OpenMP/simd_ast_print.cpp')
| -rw-r--r-- | clang/test/OpenMP/simd_ast_print.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/clang/test/OpenMP/simd_ast_print.cpp b/clang/test/OpenMP/simd_ast_print.cpp index cabbe338db2..99c00c6dca8 100644 --- a/clang/test/OpenMP/simd_ast_print.cpp +++ b/clang/test/OpenMP/simd_ast_print.cpp @@ -6,6 +6,58 @@ #ifndef HEADER #define HEADER +struct SS { + SS(): a(0) {} + SS(int v) : a(v) {} + int a; + typedef int type; +}; + +template <typename T> +class S7 : public T { +protected: + T *a; + T b[2]; + S7() : a(0) {} + +public: + S7(typename T::type &v) : a((T*)&v) { +#pragma omp simd aligned(a) + for (int k = 0; k < a->a; ++k) + ++this->a->a; + } + S7 &operator=(S7 &s) { +#pragma omp simd aligned(this->b : 8) + for (int k = 0; k < s.a->a; ++k) + ++s.a->a; + return *this; + } +}; + +// CHECK: #pragma omp simd aligned(this->a) +// CHECK: #pragma omp simd aligned(this->a) +// CHECK: #pragma omp simd aligned(this->b: 8) + +class S8 : public S7<SS> { + S8() {} + +public: + S8(int v) : S7<SS>(v){ +#pragma omp simd aligned(S7<SS>::a) + for (int k = 0; k < a->a; ++k) + ++this->a->a; + } + S8 &operator=(S8 &s) { +#pragma omp simd aligned(this->b: 4) + for (int k = 0; k < s.a->a; ++k) + ++s.a->a; + return *this; + } +}; + +// CHECK: #pragma omp simd aligned(this->S7<SS>::a) +// CHECK: #pragma omp simd aligned(this->b: 4) + void foo() {} int g_ind = 1; template<class T, class N> T reduct(T* arr, N num) { |

