struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-cvt-1.c
blob3da89afce235376f7c7fd0d8bbf3d0b55ca83ea9
1 /*
2 cvt-1.c from the execute part of the gcc torture tests.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma disable_warning 93
9 #endif
11 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
12 static inline long
13 g1 (double x)
15 return (double) (long) x;
18 long
19 g2 (double f)
21 return f;
24 double
25 f (long i)
27 if (g1 (i) != g2 (i))
28 ASSERT (0);
29 return g2 (i);
31 #endif
33 void
34 testTortureExecute (void)
36 #if 0 // TODO: Enable when SDCC supports double!
37 if (f (123456789L) != 123456789L)
38 ASSERT (0);
39 if (f (123456789L) != g2 (123456789L))
40 ASSERT (0);
41 return;
42 #endif