From 2dabb7749dfc9ac47188a3e1954feccb8c759079 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Sat, 6 Jan 2024 12:54:03 +0100 Subject: [PATCH] std.cfg: Added support for invalidFunctionArg check to tgamma(). --- cfg/std.cfg | 9 +++++++++ test/cfg/std.cpp | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/cfg/std.cfg b/cfg/std.cfg index 70c05e57b1f..b32b4cae74a 100644 --- a/cfg/std.cfg +++ b/cfg/std.cfg @@ -737,6 +737,7 @@ + @@ -746,8 +747,11 @@ + + !0.0: + @@ -757,8 +761,11 @@ + + !0.0: + @@ -768,6 +775,8 @@ + + !0.0: diff --git a/test/cfg/std.cpp b/test/cfg/std.cpp index 8bb7c29f48b..28279b77a6f 100644 --- a/test/cfg/std.cpp +++ b/test/cfg/std.cpp @@ -2406,6 +2406,30 @@ void invalidFunctionArg_lgamma(float f, double d, long double ld) (void)lgammal(0.1L); } +void invalidFunctionArg_tgamma(float f, double d, long double ld) +{ + (void)tgamma(d); + // cppcheck-suppress invalidFunctionArg + (void)tgamma(-0.1); + // cppcheck-suppress invalidFunctionArg + (void)tgamma(0.0); + (void)tgamma(0.1); + + (void)tgammaf(f); + // cppcheck-suppress invalidFunctionArg + (void)tgammaf(-0.1f); + // cppcheck-suppress invalidFunctionArg + (void)tgammaf(0.0f); + (void)tgammaf(0.1f); + + (void)tgammal(ld); + // cppcheck-suppress invalidFunctionArg + (void)tgammal(-0.1L); + // cppcheck-suppress invalidFunctionArg + (void)tgammal(0.0L); + (void)tgammal(0.1L); +} + void uninitvar_lgamma(void) { float f;