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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20040309-1.c] - Blame information for rev 816

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

Line No. Rev Author Line
1 297 jeremybenn
extern void abort ();
2
 
3
int foo(unsigned short x)
4
{
5
  unsigned short y;
6
  y = x > 32767 ? x - 32768 : 0;
7
  return y;
8
}
9
 
10
int main()
11
{
12
  if (foo (0) != 0)
13
    abort ();
14
  if (foo (32767) != 0)
15
    abort ();
16
  if (foo (32768) != 0)
17
    abort ();
18
  if (foo (32769) != 1)
19
    abort ();
20
  if (foo (65535) != 32767)
21
    abort ();
22
  return 0;
23
}
24
 

powered by: WebSVN 2.1.0

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