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/] [vect/] [vect-iv-9.c] - Blame information for rev 298

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 26
7
int a[N];
8
 
9
__attribute__ ((noinline)) int main1 (int X)
10
{
11
  int s = X;
12
  int i;
13
 
14
  /* vectorization of reduction with induction.  */
15
  for (i = 0; i < N; i++)
16
    s += (i + a[i]);
17
 
18
  return s;
19
}
20
 
21
int main (void)
22
{
23
  int s, i;
24
  check_vect ();
25
 
26
  for (i = 0; i < N; i++)
27
    a[i] = 2*i;
28
 
29
  s = main1 (3);
30
  if (s != 978)
31
    abort ();
32
 
33
  return 0;
34
}
35
 
36
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_int_mult } } } */
37
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target {! vect_int_mult } } } } */
38
/* { 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.