gcc/testsuite/g++.dg/ext/vector32a.C
raw| 1 | // PR c++/68703 |
| 2 | |
| 3 | template <int N> |
| 4 | struct D { |
| 5 | int v __attribute__((vector_size (N * sizeof (int)))); |
| 6 | int f1 () { return this->v[N-1]; } |
| 7 | int f2 () { return v[N-1]; } |
| 8 | }; |
| 9 | |
| 10 | int |
| 11 | main () |
| 12 | { |
| 13 | D<4> a = { { 0, 1, 2, 3 } }; |
| 14 | D<8> b = { { 0, 1, 2, 3, 4, 5, 6, 7 } }; |
| 15 | if (a.f1 () != 3 || a.f2 () != 3 |
| 16 | || b.f1 () != 7 || b.f2 () != 7) |
| 17 | __builtin_abort (); |
| 18 | } |