Improved testing of std.cfg and added more test cases.

This commit is contained in:
orbitcowboy 2015-08-31 13:35:57 +02:00
parent d1ba919e39
commit 0dd0f2a97d
3 changed files with 68 additions and 2 deletions

View File

@ -1077,7 +1077,7 @@
<!-- double frexp(double x, int *exp); --> <!-- double frexp(double x, int *exp); -->
<!-- float frexpf(float x, int *exp); --> <!-- float frexpf(float x, int *exp); -->
<!-- long double frexpl(long double x, int *exp); --> <!-- long double frexpl(long double x, int *exp); -->
<function name="frexp,frexpf,frexpl"> <function name="frexp,std::frexp,frexpf,frexpl">
<noreturn>false</noreturn> <noreturn>false</noreturn>
<leak-ignore/> <leak-ignore/>
<arg nr="1"> <arg nr="1">
@ -1090,7 +1090,7 @@
<!-- double hypot(double x, double y); --> <!-- double hypot(double x, double y); -->
<!-- float hypotf(float x, float y); --> <!-- float hypotf(float x, float y); -->
<!-- long double hypotl(long double x, long double y); --> <!-- long double hypotl(long double x, long double y); -->
<function name="hypot,hypotf,hypotl"> <function name="hypot,std::hypot,hypotf,hypotl">
<use-retval/> <use-retval/>
<pure/> <pure/>
<noreturn>false</noreturn> <noreturn>false</noreturn>

View File

@ -1324,6 +1324,39 @@ void uninitvar_freopen(void)
free(p); free(p);
} }
void uninitvar_frexp(void)
{
float f1;
int *i1;
// cppcheck-suppress uninitvar
(void)frexpf(f1,i1);
double d1;
int *i2;
// cppcheck-suppress uninitvar
(void)frexp(d1,i2);
long double ld1;
int *i3;
// cppcheck-suppress uninitvar
(void)frexpl(ld1,i3);
}
void uninitvar_hypot(void)
{
float f1,f2;
// cppcheck-suppress uninitvar
(void)hypotf(f1,f2);
double d1,d2;
// cppcheck-suppress uninitvar
(void)hypot(d1,d2);
long double ld1,ld2;
// cppcheck-suppress uninitvar
(void)hypotl(ld1,ld2);
}
void ignoreretrn(void) void ignoreretrn(void)
{ {
char szNumbers[] = "2001 60c0c0 -1101110100110100100000 0x6fffff"; char szNumbers[] = "2001 60c0c0 -1101110100110100100000 0x6fffff";

View File

@ -846,3 +846,36 @@ void uninitvar_freopen(void)
FILE * p = std::freopen(filename,mode,stream); FILE * p = std::freopen(filename,mode,stream);
free(p); free(p);
} }
void uninitvar_frexp(void)
{
float f1;
int *i1;
// cppcheck-suppress uninitvar
(void)std::frexp(f1,i1);
double d1;
int *i2;
// cppcheck-suppress uninitvar
(void)std::frexp(d1,i2);
long double ld1;
int *i3;
// cppcheck-suppress uninitvar
(void)std::frexp(ld1,i3);
}
void uninitvar_hypot(void)
{
float f1,f2;
// cppcheck-suppress uninitvar
(void)std::hypot(f1,f2);
double d1,d2;
// cppcheck-suppress uninitvar
(void)std::hypot(d1,d2);
long double ld1,ld2;
// cppcheck-suppress uninitvar
(void)std::hypot(ld1,ld2);
}