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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-66.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 16
7
 
8
__attribute__ ((noinline))
9
void main1 ()
10
{
11
  int i, j;
12
  int ia[8][5][N+2];
13
 
14
  /* Multidimensional array. Aligned. */
15
  for (i = 0; i < 16; i++)
16
    {
17
      for (j = 0; j < N; j++)
18
        {
19
           ia[2][6][j] = 5;
20
        }
21
    }
22
 
23
  /* check results: */
24
  for (i = 0; i < 16; i++)
25
    {
26
      for (j = 0; j < N; j++)
27
        {
28
           if (ia[2][6][j] != 5)
29
                abort();
30
        }
31
    }
32
}
33
 
34
__attribute__ ((noinline))
35
void main2 ()
36
{
37
  int i, j;
38
  int ia[8][5][N+2];
39
 
40
  /* Multidimensional array. Aligned. */
41
  for (i = 0; i < 16; i++)
42
    {
43
      for (j = 0; j < N; j++)
44
           ia[3][6][j+2] = 5;
45
    }
46
 
47
  /* check results: */
48
  for (i = 0; i < 16; i++)
49
    {
50
      for (j = 2; j < N+2; j++)
51
        {
52
           if (ia[3][6][j] != 5)
53
                abort();
54
        }
55
    }
56
}
57
 
58
__attribute__ ((noinline))
59
void main3 ()
60
{
61
  int i, j;
62
  int ic[16][16][5][N+2];
63
 
64
  /* Multidimensional array. Not aligned. */
65
  for (i = 0; i < 16; i++)
66
    {
67
      for (j = 0; j < N; j++)
68
        {
69
           ic[2][1][6][j+1] = 5;
70
        }
71
    }
72
 
73
  /* check results: */
74
  for (i = 0; i < 16; i++)
75
    {
76
      for (j = 0; j < N; j++)
77
        {
78
           if (ic[2][1][6][j+1] != 5)
79
                abort();
80
        }
81
    }
82
}
83
 
84
int main (void)
85
{
86
  check_vect ();
87
 
88
  main1 ();
89
  main2 ();
90
  main3 ();
91
 
92
  return 0;
93
}
94
 
95
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 3 "vect" } } */
96
/* { 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.