diff options
Diffstat (limited to 'test/OpenMP/simd_ast_print.cpp')
-rw-r--r-- | test/OpenMP/simd_ast_print.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/test/OpenMP/simd_ast_print.cpp b/test/OpenMP/simd_ast_print.cpp index cabbe338db2a4..99c00c6dca814 100644 --- a/test/OpenMP/simd_ast_print.cpp +++ b/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) { |