aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/pr59354.c
blob: d479d00ceee43c8bb643367270e75341e003ad98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* { dg-additional-options "-O3" } */

#include "tree-vect.h"

void abort (void);

unsigned int a[256];
unsigned char b[256];

__attribute__ ((noinline)) void
main1()
{
  int i, z, x, y;

  for(i = 0; i < 256; i++)
    {
      a[i] = i % 5;
      __asm__ volatile ("");
    }

  for (z = 0; z < 16; z++)
    for (y = 0; y < 4; y++)
      for (x = 0; x < 4; x++)
	b[y*64 + z*4 + x] = a[z*16 + y*4 + x];

  if (b[4] != 1)
    abort ();
}

int main (void)
{
  check_vect ();

  main1 ();

  return 0;
}

/* { dg-final { scan-tree-dump "vectorized 1 loop" "vect" { target { vect_pack_trunc } } } } */