| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-additional-options "-O3" } */ |
| 3 |
/* { dg-additional-options "-march=armv8.2-a+sve" { target aarch64-*-* } } */ |
| 4 |
/* { dg-skip-if "requires hosted libstdc++ for vector" { ! hostedlib } } */ |
| 5 |
|
| 6 |
#include <vector> |
| 7 |
|
| 8 |
template<typename ValueType> |
| 9 |
struct BasicVector |
| 10 |
{ |
| 11 |
ValueType& operator[](int i) { return x_[i]; } |
| 12 |
ValueType operator[](int i) const { return x_[i]; } |
| 13 |
ValueType x_[3]; |
| 14 |
}; |
| 15 |
typedef int ivec1[3]; |
| 16 |
typedef BasicVector<double> RVec1; |
| 17 |
void foo ( |
| 18 |
std::vector<RVec1> &x_, |
| 19 |
std::vector<RVec1> &xp_, |
| 20 |
int homenr, |
| 21 |
unsigned short* cFREEZE, |
| 22 |
const ivec1* nFreeze) |
| 23 |
{ |
| 24 |
std::vector<RVec1> xp = xp_; |
| 25 |
std::vector<RVec1> x = x_; |
| 26 |
for (int i = 0; i < homenr; i++) |
| 27 |
{ |
| 28 |
const int g = cFREEZE[i]; |
| 29 |
for (int d = 0; d < 3; d++) |
| 30 |
{ |
| 31 |
if (nFreeze[g][d] == 0) |
| 32 |
x[i][d] = xp[i][d]; |
| 33 |
} |
| 34 |
} |
| 35 |
} |