struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-930603-1.c
blob4f0cf46e23d1a12cabe61645df9ded9bc69a7301
1 /*
2 930603-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
12 float fx (float x)
14 return 1.0 + 3.0 / (2.302585093 * x);
17 float inita ();
18 float initc ();
19 void f ();
20 #endif
22 void
23 testTortureExecute (void)
25 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
26 float a, b, c;
27 a = inita ();
28 c = initc ();
29 f ();
30 b = fx (c) + a;
31 f ();
32 if (a != 3.0 || b < 4.3257 || b > 4.3258 || c != 4.0)
33 ASSERT (0);
34 return;
35 #endif
38 float inita () { return 3.0; }
39 float initc () { return 4.0; }
40 void f () {}