OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-101.c] - Blame information for rev 853

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdlib.h>
4
#include <stdarg.h>
5
#include "tree-vect.h"
6
 
7
#define N 9
8
 
9
struct extraction
10
{
11
  int a[N];
12
  int b[N];
13
};
14
 
15
static int a[N] = {1,2,3,4,5,6,7,8,9};
16
static int b[N] = {2,3,4,5,6,7,8,9,0};
17
 
18
int main1 (int x, int y) {
19
  int i;
20
  struct extraction *p;
21
  p = (struct extraction *) malloc (sizeof (struct extraction));
22
 
23
  /* Not vectorizable: different unknown offset.  */
24
  for (i = 0; i < N; i++)
25
    {
26
      *((int *)p + x + i) = a[i];
27
      *((int *)p + y + i) = b[i];
28
    }
29
 
30
  /* check results: */
31
  for (i = 0; i < N; i++)
32
    {
33
       if (p->a[i] != a[i] || p->b[i] != b[i])
34
         abort();
35
    }
36
  return 0;
37
}
38
 
39
int main (void)
40
{
41
  check_vect ();
42
 
43
  return main1 (0, N);
44
}
45
 
46
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 0 "vect" } } */
47
/* { dg-final { scan-tree-dump-times "can't determine dependence" 1 "vect" } } */
48
/* { dg-final { cleanup-tree-dump "vect" } } */
49
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.