| 1 |
/* PR target/64252 */ |
| 2 |
/* Test correctness of size 3 store groups permutation. */ |
| 3 |
/* { dg-additional-options "-O3" } */ |
| 4 |
/* { dg-additional-options "-mavx" { target avx_runtime } } */ |
| 5 |
|
| 6 |
#include "tree-vect.h" |
| 7 |
|
| 8 |
#define N 50 |
| 9 |
|
| 10 |
enum num3 |
| 11 |
{ |
| 12 |
a, b, c |
| 13 |
}; |
| 14 |
|
| 15 |
struct flags |
| 16 |
{ |
| 17 |
enum num3 f; |
| 18 |
unsigned int c; |
| 19 |
unsigned int p; |
| 20 |
}; |
| 21 |
|
| 22 |
struct flagsN |
| 23 |
{ |
| 24 |
struct flags a[N]; |
| 25 |
}; |
| 26 |
|
| 27 |
void |
| 28 |
bar (int n, struct flagsN *ff) |
| 29 |
{ |
| 30 |
struct flagsN *fc; |
| 31 |
for (fc = ff + 1; fc < (ff + n); fc++) |
| 32 |
{ |
| 33 |
int i; |
| 34 |
for (i = 0; i < N; ++i) |
| 35 |
{ |
| 36 |
ff->a[i].f = 0; |
| 37 |
ff->a[i].c = i; |
| 38 |
ff->a[i].p = -1; |
| 39 |
} |
| 40 |
for (i = 0; i < n; i++) |
| 41 |
{ |
| 42 |
int j; |
| 43 |
for (j = 0; j < N - n; ++j) |
| 44 |
{ |
| 45 |
fc->a[i + j].f = 0; |
| 46 |
fc->a[i + j].c = j + i; |
| 47 |
fc->a[i + j].p = -1; |
| 48 |
} |
| 49 |
} |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
struct flagsN q[2]; |
| 54 |
|
| 55 |
int main() |
| 56 |
{ |
| 57 |
int i; |
| 58 |
check_vect (); |
| 59 |
bar(2, q); |
| 60 |
#pragma GCC novector |
| 61 |
for (i = 0; i < N; i++) |
| 62 |
if (q[0].a[i].f != 0 || q[0].a[i].c != i || q[0].a[i].p != -1) |
| 63 |
abort (); |
| 64 |
return 0; |
| 65 |
} |