float_sret.c
357 Bytes
////C: '-msoft-float'
/* test function which returns structure */
typedef struct ts {
int i;
unsigned u;
float f;
} ts_t;
ts_t func(ts_t x)
{
volatile ts_t tmp;
tmp.i = (int)x.u;
tmp.u = (unsigned)x.i;
tmp.f = -x.f;
return tmp;
}
int main(void)
{
volatile ts_t A = {.i=1234,.u=4321,.f=1.2345F};
A = func(A);
return 0;
}