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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [vect-reduc-10.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
#include "tree-vect.h"
2
 
3
extern void abort (void);
4
double ad[1024];
5
float af[1024];
6
short as[1024];
7
int ai[1024];
8
long long all[1024];
9
unsigned short aus[1024];
10
unsigned int au[1024];
11
unsigned long long aull[1024];
12
 
13
#define F(var) \
14
__attribute__((noinline, noclone)) __typeof (var[0]) \
15
f##var (void) \
16
{ \
17
  int i; \
18
  __typeof (var[0]) r = 0; \
19
  for (i = 0; i < 1024; i++) \
20
    r = r > var[i] ? r : var[i]; \
21
  return r; \
22
}
23
 
24
#define TESTS \
25
F (ad) F (af) F (as) F (ai) F (all) F (aus) F (au) F (aull)
26
 
27
TESTS
28
 
29
int
30
main ()
31
{
32
  int i;
33
 
34
  check_vect ();
35
 
36
  for (i = 0; i < 1024; i++)
37
    {
38
#undef F
39
#define F(var) var[i] = i;
40
      TESTS
41
    }
42
  for (i = 1023; i < 32 * 1024; i += 1024 + 271)
43
    {
44
#undef F
45
#define F(var) var[i & 1023] = i; if (f##var () != i) abort ();
46
      TESTS
47
    }
48
  return 0;
49
}
50
 
51
/* { 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.