Debian Codegraph @

gcc/testsuite/gcc.c-torture/execute/cvt-1.c

raw
1 void abort (void);
2 void exit (int);
3
4 static inline long
5 g1 (double x)
6 {
7 return (double) (long) x;
8 }
9
10 long
11 g2 (double f)
12 {
13 return f;
14 }
15
16 double
17 f (long i)
18 {
19 if (g1 (i) != g2 (i))
20 abort ();
21 return g2 (i);
22 }
23
24 int
25 main (void)
26 {
27 if (f (123456789L) != 123456789L)
28 abort ();
29 if (f (123456789L) != g2 (123456789L))
30 abort ();
31 exit (0);
32 }