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/] [unsorted/] [conv_tst.c] - Blame information for rev 12

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 12 jlechner
#define ID_1 2400000000.0
2
#define ID_2 1.7
3
#define ID_3 -1.7
4
 
5
unsigned ui;
6
int si;
7
 
8
conv_i1 ()
9
{
10
/*
11
  ui = (unsigned) ID_1;
12
  si = (int) ID_1;
13
*/
14
}
15
 
16
conv_i2 ()
17
{
18
  ui = (unsigned) ID_2;
19
  si = (int) ID_2;
20
}
21
 
22
conv_i3 ()
23
{
24
/*  ui = (unsigned) ID_3;*/
25
  si = (int) ID_3;
26
}
27
 
28
conv_1 (d)
29
     double d;
30
{
31
  ui = (unsigned) d;
32
/*
33
  si = (int) d;
34
*/
35
}
36
 
37
double
38
foo (u)
39
     unsigned u;
40
{
41
  return u;
42
}
43
 
44
main ()
45
{
46
  printf ("%lf\n", foo (2400000000));
47
 
48
  conv_i1 ();
49
  printf ("%lf, %u, %d\n", ID_1, ui, si);
50
 
51
  conv_i2 ();
52
  printf ("%lf, %u, %d\n", ID_2, ui, si);
53
 
54
  conv_i3 ();
55
  printf ("%lf, %u, %d\n", ID_3, ui, si);
56
 
57
  conv_1 (ID_1);
58
  printf ("%lf, %u, %d\n", ID_1, ui, si);
59
 
60
  conv_1 (ID_2);
61
  printf ("%lf, %u, %d\n", ID_2, ui, si);
62
 
63
  conv_1 (ID_3);
64
  printf ("%lf, %u, %d\n", ID_3, ui, si);
65
 
66
}

powered by: WebSVN 2.1.0

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