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

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [20040309-1.c] - Blame information for rev 12

Details | Compare with Previous | View Log

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