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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [vector-compare-2.c] - Blame information for rev 688

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
#define vector(elcount, type)  \
2
__attribute__((vector_size((elcount)*sizeof(type)))) type
3
 
4
/* Check that constant folding in
5
   these simple cases works.  */
6
vector (4, int)
7
foo (vector (4, int) x)
8
{
9
  return   (x == x) + (x != x) + (x >  x)
10
         + (x <  x) + (x >= x) + (x <= x);
11
}
12
 
13
int
14
main (int argc, char *argv[])
15
{
16
  vector (4, int) t = {argc, 2, argc, 42};
17
  vector (4, int) r;
18
  int i;
19
 
20
  r = foo (t);
21
 
22
  for (i = 0; i < 4; i++)
23
    if (r[i] != -3)
24
      __builtin_abort ();
25
 
26
  return 0;
27
}

powered by: WebSVN 2.1.0

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