diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-07-16 11:40:25 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2015-07-16 11:40:25 +0000 |
commit | 8cd167a5ad8baf4988e07fcbc9c9cc338c02d3d1 (patch) | |
tree | 74fd60c507288ef44ed7f786fafeecbb5df0e160 /gcc/testsuite/g++.dg/vect/simd-clone-1.cc | |
parent | f80b5ea1605c9f9408c5aa386ba71c16d918ebbf (diff) | |
download | gcc-tarball-8cd167a5ad8baf4988e07fcbc9c9cc338c02d3d1.tar.gz |
gcc-5.2.0gcc-5.2.0
Diffstat (limited to 'gcc/testsuite/g++.dg/vect/simd-clone-1.cc')
-rw-r--r-- | gcc/testsuite/g++.dg/vect/simd-clone-1.cc | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/vect/simd-clone-1.cc b/gcc/testsuite/g++.dg/vect/simd-clone-1.cc new file mode 100644 index 0000000000..f0be59aa60 --- /dev/null +++ b/gcc/testsuite/g++.dg/vect/simd-clone-1.cc @@ -0,0 +1,55 @@ +// { dg-require-effective-target vect_simd_clones } +// { dg-additional-options "-fopenmp-simd -fno-inline" } +// { dg-additional-options "-mavx" { target avx_runtime } } + +#include "../../gcc.dg/vect/tree-vect.h" + +struct S +{ + int s; + #pragma omp declare simd notinbranch linear(x) + int f (int x); +}; + +#pragma omp declare simd notinbranch linear(x) +int +S::f (int x) +{ + return x; +} + +template <int N> +struct T +{ + int t; + #pragma omp declare simd notinbranch linear(x) + int f (int x); +}; + +#pragma omp declare simd notinbranch linear(x) +template <int N> +int +T<N>::f (int x) +{ + return x; +} + +void +do_main () +{ + int i, r = 0; + S s; + T<0> t; + #pragma omp simd reduction(+:r) + for (i = 0; i < 64; i++) + r += s.f (i) + t.f (i); + if (r != 64 * 63) + abort (); +} + +int +main () +{ + check_vect (); + do_main (); +} |