posix.cfg: Improved test cases for ffs().

This commit is contained in:
orbitcowboy 2022-05-01 18:15:32 +02:00
parent 6ad5a94acf
commit 6a657865eb
1 changed files with 3 additions and 1 deletions

View File

@ -38,7 +38,9 @@ void knownConditionTrueFalse_ffs(int i)
// ffs() returns the position of the first bit set, or 0 if no bits are set in i.
const int x = ffs(0);
// cppcheck-suppress knownConditionTrueFalse
if (x == 0) {}
if (x == 0) {} // always true
// cppcheck-suppress knownConditionTrueFalse
if (x == 1) {} // always false
if (ffs(i) == 0) {}
}