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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-vfa-02.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-require-effective-target vect_int } */
2
 
3
#include <stdarg.h>
4
#include "tree-vect.h"
5
 
6
#define N 16
7
int resultY[N] = {12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27};
8
int resultZ[N] = {13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28};
9
int X[N] = {10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25};
10
int Y[N] = {};
11
int Z[N] = {};
12
 
13
__attribute__ ((noinline)) void
14
foo (int *in, int *out1, int *out2)
15
{
16
  int i;
17
 
18
  for (i = 0; i < N; i++)
19
    {
20
      out1[i] = in[i] + 2;
21
      out2[i] = in[i] + 3;
22
    }
23
}
24
 
25
int
26
main (void)
27
{
28
  int i;
29
 
30
  check_vect ();
31
 
32
  foo (X, Y, Z);
33
 
34
  /* check results:  */
35
  for (i = 0; i < N; i++)
36
    {
37
      if (Y[i] != resultY[i])
38
        abort ();
39
 
40
      if (Z[i] != resultZ[i])
41
        abort ();
42
    }
43
  return 0;
44
}
45
 
46
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
47
/* { 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.