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-align-1.c] - Blame information for rev 816

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
/* Compile time known misalignment. Cannot use loop peeling to align
8
   the store.  */
9
 
10
#define N 16
11
 
12
struct foo {
13
  char x;
14
  int y[N];
15
} __attribute__((packed));
16
 
17
int
18
main1 (struct foo * __restrict__ p)
19
{
20
  int i;
21
  int x[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
22
 
23
  for (i = 0; i < N; i++)
24
    {
25
      p->y[i] = x[i];
26
    }
27
 
28
  /* check results:  */
29
  for (i = 0; i < N; i++)
30
    {
31
      if (p->y[i] != x[i])
32
        abort ();
33
    }
34
  return 0;
35
}
36
 
37
 
38
int main (void)
39
{
40
  int i;
41
  struct foo *p = malloc (2*sizeof (struct foo));
42
  check_vect ();
43
 
44
  main1 (p);
45
  return 0;
46
}
47
 
48
/* { dg-final { scan-tree-dump-times "Alignment of access forced using versioning" 1 "vect" } } */
49
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
50
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

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