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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vector-init-2.c] - Blame information for rev 315

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

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
 
3
/* PR C/31499, test that the C front-end treats vectors like an array
4
   and that it works at runtime. */
5
 
6
#define vector __attribute__((__vector_size__(4*sizeof(int)) ))
7
vector signed int v1[]={0,1,2,3,4,5,6,7};
8
 
9
 
10
int main(void)
11
{
12
  int i;
13
  for (i = 0; i < sizeof(v1)/sizeof(v1[0]); i++)
14
  {
15
    vector int t = v1[i];
16
    int *d = (int*)&t;
17
    int j;
18
    for (j = 0; j < 4; j++)
19
      {
20
        if (d[j] != i * 4 + j)
21
          __builtin_abort ();
22
      }
23
  }
24
  return 0;
25
}

powered by: WebSVN 2.1.0

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