32#if defined (__IBMCPP__) && !defined (_RWSTD_NO_IMPLICIT_INCLUSION)
36# define _RWSTD_NO_IMPLICIT_INCLUSION
56 static const char* const tname = rw_any_t (T ()).type_name (); \
57 rw_assert (0, 0, __LINE__, "std::%s(%s) not declared\n", \
60 } typedef void unused_typedef
65 static const char* const tname = rw_any_t (T ()).type_name (); \
66 rw_assert (0, 0, __LINE__, "std::%s (%s, %s) not declared\n", \
67 #name, tname, tname); \
69 } typedef void unused_typedef
71#define FUN_2_PTR(name) \
74 static const char* const tname = rw_any_t (T ()).type_name (); \
75 rw_assert (0, 0, __LINE__, "std::%s (%s, %s*) not declared\n", \
76 #name, tname, tname); \
78 } typedef void unused_typedef
80#define FUN_2_INT(name) \
83 static const char* const tname = rw_any_t (T ()).type_name (); \
84 rw_assert (0, 0, __LINE__, "std::%s (%s, int) not declared\n", \
87 } typedef void unused_typedef
89#define FUN_2_PINT(name) \
92 static const char* const tname = rw_any_t (T ()).type_name (); \
93 rw_assert (0, 0, __LINE__, "std::%s (%s, int*) not declared\n", \
96 } typedef void unused_typedef
134check_bits (
const char *
s, std::size_t
size)
137 return unsigned (-1) ==
size;
142clear_bytes (
void *pb, _RWSTD_SIZE_T
size)
144 for (_RWSTD_SIZE_T
i = 0;
i !=
size; ++
i)
156#ifndef _RWSTD_NO_LONG_DOUBLE
160 char buf [
sizeof (
long double) * 2];
163#if !defined (__SUNPRO_CC) || __SUNPRO_CC > 0x530
166 clear_bytes (
u.buf,
sizeof u);
168 const float f = std::modf (3.141592f, &
u.f);
170 rw_assert ( 3000 ==
int (
u.f * 1000) && 141592 == int (
f * 1000000)
171 && check_bits (
u.buf + sizeof (
u.f), sizeof (
u) -
sizeof (
u.f)),
172 __FILE__, __LINE__,
"float std::modf (float)");
176 clear_bytes (
u.buf,
sizeof u);
177 const double d = std::modf (3.1415926, &
u.d);
179 rw_assert ( 3000 ==
int (
u.d * 1000) && 1415926 == int (
d * 10000000)
180 && check_bits (
u.buf + sizeof (
u.d), sizeof (
u) -
sizeof (
u.d)),
181 __FILE__, __LINE__,
"double std::modf (double)");
183#ifndef _RWSTD_NO_LONG_DOUBLE
185# if !defined (__SUNPRO_CC) || __SUNPRO_CC > 0x530
187 clear_bytes (
u.buf,
sizeof u);
188 const long double l = std::modf (3.1415926L, &
u.l);
190 rw_assert ( 3000 ==
int (
u.l * 1000) && 1415926 == int (l * 10000000)
191 && check_bits (
u.buf + sizeof (
u.l), sizeof (
u) -
sizeof (
u.l)),
192 __FILE__, __LINE__,
"long double std::modf (long double)");
199 for (
int i = -10;
i != 10; ++
i) {
201 for (
int j = -10;
j != 10; ++
j) {
203 if (-9 <
j &&
j < 9) {
204 const float fi = float (
i);
205 const float fj = float (
j);
208 const float xf = std::pow (fi,
j);
209 const float yf = std::pow (fi, fj);
213 "std::pow (%d.0f, %d) = %g, "
214 "std::pow (%d,0f, %d.0f) = %g",
218 const double id = double (
i);
219 const double jd = double (
j);
221 const double xd = std::pow (
id,
j);
222 const double yd = std::pow (
id, jd);
226 "std::pow (%d.0, %d) = %g, "
227 "std::pow (%d.0, %d.0) = %g",
230#ifndef _RWSTD_NO_LONG_DOUBLE
235 const long double xl = std::pow (il,
j);
236 const long double yl = std::pow (il, jl);
240 "std::pow (%d.0L, %d) = %Lg, "
241 "std::pow (%d.0L, %d.0L) = %Lg",
262#ifndef _RWSTD_NO_LONG_DOUBLE
264 long double ld = 0.1;
266# define CHECK_OVERLOADS(name) \
267 rw_info (0, 0, __LINE__, "std::%s() overloads ", #name); \
272# define CHECK_OVERLOADS(name) \
273 rw_info (0, 0, __LINE__, "std::%s() overloads", #name); \
290 rw_info (0, 0, __LINE__,
"std::%s() overloads",
"fmod");
291 (void)fmod (
f,
f); (void)fmod (
d,
d);
293 rw_info (0, 0, __LINE__,
"std::%s() overloads",
"frexp");
294 (void)frexp (
f, &
i); (void)frexp (
d, &
i);
296 rw_info (0, 0, __LINE__,
"std::%s() overloads",
"ldexp");
297 (void)ldexp (
f,
i); (void)ldexp (
d,
i);
302 rw_info (0, 0, __LINE__,
"std::%s() overloads",
"modf");
303 (void)modf (
f, &
f); (void)modf (
d, &
d);
305 rw_info (0, 0, __LINE__,
"std::%s() overloads",
"pow");
306 (void)pow (
f,
f); (void)pow (
d,
d);
307 (void)pow (
f,
i); (void)pow (
d,
i);
315#ifndef _RWSTD_NO_LONG_DOUBLE
317 (void)atan2 (ld, ld);
319 (void)frexp (ld, &
i);
321 (void)modf (ld, &ld);
327 rw_info (0, 0, __LINE__,
"std::%s() overloads",
"div");
334static int no_declarations;
335static int no_behavior;
341 rw_note (0, __FILE__, __LINE__,
"test of declarations disabled");
343 test_declarations ();
346 rw_note (0, __FILE__, __LINE__,
"test of behavior disabled");
355int main (
int argc,
char *argv[])
357 return rw_test (argc, argv, __FILE__,
360 "|-no-declarations# |-no-behavior#",
361 &no_declarations, &no_behavior);
int run_test(int, char *[])
#define CHECK_OVERLOADS(name)
#define _RWSTD_STATIC_CAST(T, x)
#define _RWSTD_NAMESPACE(name)
_TEST_EXPORT int rw_test(int argc, char *argv[], const char *filename, const char *clause, const char *comment, int(*testfun)(int, char **), const char *optspec,...)
_TEST_EXPORT int rw_info(int, const char *, int, const char *,...)
_TEST_EXPORT int rw_note(int, const char *, int, const char *,...)
_TEST_EXPORT int rw_assert(int, const char *, int, const char *,...)