OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr45262.c] - Blame information for rev 414

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 414 jeremybenn
/* PR middle-end/45262 */
2
 
3
extern void abort (void);
4
 
5
int
6
foo (unsigned int x)
7
{
8
  return ((int) x < 0) || ((int) (-x) < 0);
9
}
10
 
11
int
12
bar (unsigned int x)
13
{
14
  return x >> 31 || (-x) >> 31;
15
}
16
 
17
int
18
main (void)
19
{
20
  if (foo (1) != 1)
21
    abort ();
22
  if (foo (0) != 0)
23
    abort ();
24
  if (foo (-1) != 1)
25
    abort ();
26
  if (bar (1) != 1)
27
    abort ();
28
  if (bar (0) != 0)
29
    abort ();
30
  if (bar (-1) != 1)
31
    abort ();
32
  return 0;
33
}

powered by: WebSVN 2.1.0

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