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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [pr45262.c] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 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.