]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/pr87320.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / pr87320.c
1 /* PR tree-optimization/87320 */
2 /* { dg-do run } */
3 /* { dg-require-effective-target alloca } */
4 /* { dg-options "-O3" } */
5 /* { dg-additional-options "-mavx" { target avx_runtime } } */
6
7 static void __attribute__ ((noinline))
8 transpose_vector (unsigned long n)
9 {
10 unsigned long data[2 * n];
11 for (unsigned long i = 0; i < 2 * n; i++)
12 data[i] = 4 * i + 2;
13
14 unsigned long transposed[n];
15 for (unsigned long i = 0; i < n; i++)
16 transposed[i] = data[2 * i];
17
18 for (unsigned long i = 0; i < n; i++)
19 if (transposed[i] != 8 * i + 2)
20 __builtin_abort ();
21 }
22
23 int
24 main ()
25 {
26 transpose_vector (4);
27 transpose_vector (120);
28 return 0;
29 }