summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/vect-98.c
blob: 118f28fd33434124b7bb6f580f38d835bfbb94be (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
40
41
42
43
/* { dg-require-effective-target vect_int } */

#include <stdarg.h>
#include "tree-vect.h"

#define N 4
#define DOT4( a, b )  ( a[0]*b[0] + a[1]*b[1] + a[2]*b[2] + a[3]*b[3] )

__attribute__ ((noinline))
int main1 (int ia[][N])
{
  int i, j;
  int ib[N] = {0,3,6,9};
  int ic[N][N];

  for (i = 0; i < N; i++)
    {
	ic[0][i] = DOT4 (ia[i], ib);
    }

  /* check results: */  
  for (i = 0; i < N; i++)
    {
       if (ic[0][i] != DOT4 (ia[i], ib))
           abort();
    }

  return 0;
}

int main (void)
{ 
  int ia[N][N] = {{1,2,3,4},{2,3,5,7},{2,4,6,8},{22,43,55,77}};

  check_vect ();

  return main1 (ia);
}

/* Needs interleaving support.  */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { vect_interleave && vect_extract_even_odd_wide } } } } */
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" { xfail  { vect_interleave && vect_extract_even_odd_wide } } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */