x86-64: Make ABI for long double compatible with GCC.

- Now we use x87's stack top the long double return values.
- Add rc_fret and reg_fret, wrapper functions for RC_FRET and REG_FRET.
- Add a test case to check if strto* works OK.
This commit is contained in:
Shinichiro Hamaji
2009-04-14 01:12:29 +09:00
committed by grischka
parent 0e239e2ba5
commit 9fe28b610e
2 changed files with 31 additions and 3 deletions

View File

@ -1399,6 +1399,11 @@ void bitfield_test(void)
#define FLOAT_FMT "%.5f\n"
#endif
/* declare strto* functions as they are C99 */
double strtod(const char *nptr, char **endptr);
float strtof(const char *nptr, char **endptr);
long double strtold(const char *nptr, char **endptr);
#define FTEST(prefix, type, fmt)\
void prefix ## cmp(type a, type b)\
{\
@ -1455,6 +1460,7 @@ void prefix ## call(void)\
printf("float: " FLOAT_FMT, prefix ## retf(42.123456789));\
printf("double: %f\n", prefix ## retd(42.123456789));\
printf("long double: %Lf\n", prefix ## retld(42.123456789));\
printf("strto%s: %f\n", #prefix, (double)strto ## prefix("1.2", NULL));\
}\
\
void prefix ## test(void)\