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

This commit is contained in:
Martin Ettl 2015-08-30 12:05:38 +02:00
parent fb643ba2d4
commit 5e9325b4f4
3 changed files with 92 additions and 3 deletions

View File

@ -874,7 +874,7 @@
<!-- double fmax(double x, double y); -->
<!-- float fmaxf(float x, float y); -->
<!-- long double fmaxl(long double x, long double y); -->
<function name="fmax,fmaxf,fmaxl">
<function name="fmax,std::fmax,fmaxf,fmaxl">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
@ -889,7 +889,7 @@
<!-- double fmin(double x, double y); -->
<!-- float fminf(float x, float y); -->
<!-- long double fminl(long double x, long double y); -->
<function name="fmin,fminf,fminl">
<function name="fmin,std::fmin,fminf,fminl">
<use-retval/>
<pure/>
<noreturn>false</noreturn>
@ -904,7 +904,7 @@
<!-- double fmod(double x, double y); -->
<!-- float fmodf(float x, float y); -->
<!-- long double fmodl(long double x, long double y); -->
<function name="fmod,fmodf,fmodl">
<function name="fmod,std::fmod,fmodf,fmodl">
<use-retval/>
<pure/>
<noreturn>false</noreturn>

View File

@ -1181,6 +1181,51 @@ void uninitvar_fma(void)
(void)fmal(ld1,ld2,ld3);
}
void uninitvar_fmax(void)
{
float f1,f2;
// cppcheck-suppress uninitvar
(void)fmaxf(f1,f2);
double d1,d2;
// cppcheck-suppress uninitvar
(void)fmax(d1,d2);
long double ld1,ld2;
// cppcheck-suppress uninitvar
(void)fmaxl(ld1,ld2);
}
void uninitvar_fmin(void)
{
float f1,f2;
// cppcheck-suppress uninitvar
(void)fminf(f1,f2);
double d1,d2;
// cppcheck-suppress uninitvar
(void)fmin(d1,d2);
long double ld1,ld2;
// cppcheck-suppress uninitvar
(void)fminl(ld1,ld2);
}
void uninitvar_fmod(void)
{
float f1,f2;
// cppcheck-suppress uninitvar
(void)fmodf(f1,f2);
double d1,d2;
// cppcheck-suppress uninitvar
(void)fmod(d1,d2);
long double ld1,ld2;
// cppcheck-suppress uninitvar
(void)fmodl(ld1,ld2);
}
void ignoreretrn(void)
{
char szNumbers[] = "2001 60c0c0 -1101110100110100100000 0x6fffff";

View File

@ -704,3 +704,47 @@ void uninitvar_fma(void)
(void)std::fma(ld1,ld2,ld3);
}
void uninitvar_fmax(void)
{
float f1,f2;
// cppcheck-suppress uninitvar
(void)std::fmax(f1,f2);
double d1,d2;
// cppcheck-suppress uninitvar
(void)std::fmax(d1,d2);
long double ld1,ld2;
// cppcheck-suppress uninitvar
(void)std::fmax(ld1,ld2);
}
void uninitvar_fmin(void)
{
float f1,f2;
// cppcheck-suppress uninitvar
(void)std::fmin(f1,f2);
double d1,d2;
// cppcheck-suppress uninitvar
(void)std::fmin(d1,d2);
long double ld1,ld2;
// cppcheck-suppress uninitvar
(void)std::fmin(ld1,ld2);
}
void uninitvar_fmod(void)
{
float f1,f2;
// cppcheck-suppress uninitvar
(void)std::fmod(f1,f2);
double d1,d2;
// cppcheck-suppress uninitvar
(void)std::fmod(d1,d2);
long double ld1,ld2;
// cppcheck-suppress uninitvar
(void)std::fmod(ld1,ld2);
}