2 struct-ret-1.c from the execute part of the gcc torture tests.
7 #pragma disable_warning 93
12 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
14 #if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02) // Todo: enable when struct parmeters are supported!
16 typedef struct { double d
; int i
[3]; } B
;
17 typedef struct { char c
[33],c1
; } X
;
37 X X1
= {"abcdefghijklmnopqrstuvwxyzABCDEF", 'G'};
39 X X3
= {"return-return-return",'R'};
41 X
f (B a
, char b
, double c
, B d
)
43 static X xr
= {"return val", 'R'};
47 sprintf (out
, "X f(B,char,double,B):({%g,{%d,%d,%d}},'%c',%g,{%g,{%d,%d,%d}})",
48 a
.d
, a
.i
[0], a
.i
[1], a
.i
[2], b
, c
, d
.d
, d
.i
[0], d
.i
[1], d
.i
[2]);
52 X (*fp
) (B
, char, double, B
) = &f
;
57 testTortureExecute (void)
59 #if !defined(__SDCC_pdk14) && !defined(__SDCC_pdk15) // Lack of memory
60 #if !defined(__SDCC_mcs51) && !defined(__SDCC_ds390) && !defined(__SDCC_hc08) && !defined(__SDCC_s08) && !defined(__SDCC_mos6502) && !defined(__SDCC_mos65c02) // Todo: enable when struct parmeters are supported!
64 Xr
= f (B1
, c2
, d3
, B2
);
66 Xr
.c
[0] = Xr
.c1
= '\0';
67 Xr
= (*fp
) (B1
, c2
, d3
, B2
);
68 if (strcmp (tmp
, out
))