Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-921208-1.c
blob354d149010263d6f9ec4491e5bbca58d2f790a31
1 /*
2 921208-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #pragma disable_warning 93
10 #endif
12 #if !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15)
13 double
14 f(double x)
16 return x*x;
19 double
20 Int(double (*f)(double), double a)
22 return (*f)(a);
24 #endif
26 void
27 testTortureExecute (void)
29 #if !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02) && !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15)
30 if (Int(&f,2.0) != 4.0)
31 ASSERT(0);
32 return;
33 #endif