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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [divmod-1.c] - Blame information for rev 717

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

Line No. Rev Author Line
1 688 jeremybenn
div1 (signed char x)
2
{
3
  return x / -1;
4
}
5
 
6
div2 (signed short x)
7
{
8
  return x / -1;
9
}
10
 
11
div3 (signed char x, signed char y)
12
{
13
  return x / y;
14
}
15
 
16
div4 (signed short x, signed short y)
17
{
18
  return x / y;
19
}
20
 
21
mod1 (signed char x)
22
{
23
  return x % -1;
24
}
25
 
26
mod2 (signed short x)
27
{
28
  return x % -1;
29
}
30
 
31
mod3 (signed char x, signed char y)
32
{
33
  return x % y;
34
}
35
 
36
mod4 (signed short x, signed short y)
37
{
38
  return x % y;
39
}
40
 
41
signed long
42
mod5 (signed long x, signed long y)
43
{
44
  return x % y;
45
}
46
 
47
unsigned long
48
mod6 (unsigned long x, unsigned long y)
49
{
50
  return x % y;
51
}
52
 
53
main ()
54
{
55
  if (div1 (-(1 << 7)) != 1 << 7)
56
    abort ();
57
  if (div2 (-(1 << 15)) != 1 << 15)
58
    abort ();
59
  if (div3 (-(1 << 7), -1) != 1 << 7)
60
    abort ();
61
  if (div4 (-(1 << 15), -1) != 1 << 15)
62
    abort ();
63
  if (mod1 (-(1 << 7)) != 0)
64
    abort ();
65
  if (mod2 (-(1 << 15)) != 0)
66
    abort ();
67
  if (mod3 (-(1 << 7), -1) != 0)
68
    abort ();
69
  if (mod4 (-(1 << 15), -1) != 0)
70
    abort ();
71
  if (mod5 (0x50000000, 2) != 0)
72
    abort ();
73
  if (mod6 (0x50000000, 2) != 0)
74
    abort ();
75
 
76
  exit (0);
77
}

powered by: WebSVN 2.1.0

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