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/] [950704-1.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 297 jeremybenn
int errflag;
2
 
3
long long
4
f (long long x, long long y)
5
{
6
  long long r;
7
 
8
  errflag = 0;
9
  r = x + y;
10
  if (x >= 0)
11
    {
12
      if ((y < 0) || (r >= 0))
13
        return r;
14
    }
15
  else
16
    {
17
      if ((y > 0) || (r < 0))
18
        return r;
19
    }
20
  errflag = 1;
21
  return 0;
22
}
23
 
24
main ()
25
{
26
  f (0, 0);
27
  if (errflag)
28
    abort ();
29
 
30
  f (1, -1);
31
  if (errflag)
32
    abort ();
33
 
34
  f (-1, 1);
35
  if (errflag)
36
    abort ();
37
 
38
  f (0x8000000000000000LL, 0x8000000000000000LL);
39
  if (!errflag)
40
    abort ();
41
 
42
  f (0x8000000000000000LL, -1LL);
43
  if (!errflag)
44
    abort ();
45
 
46
  f (0x7fffffffffffffffLL, 0x7fffffffffffffffLL);
47
  if (!errflag)
48
    abort ();
49
 
50
  f (0x7fffffffffffffffLL, 1LL);
51
  if (!errflag)
52
    abort ();
53
 
54
  f (0x7fffffffffffffffLL, 0x8000000000000000LL);
55
  if (errflag)
56
    abort ();
57
 
58
  exit (0);
59
}

powered by: WebSVN 2.1.0

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