Skip to content

Commit

Permalink
Fix copy&paste error: check_long_long should check __builtin_ssubll_o…
Browse files Browse the repository at this point in the history
…verflow

The constants are of the right type, but __builtin_ssubl_overflow was
used instead of __builtin_ssubll_overflow (which, however, made no
difference on 64-bit Linux platforms, which most of our tests run on).
  • Loading branch information
tautschnig committed Mar 8, 2021
1 parent 104ba11 commit afe88cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions regression/cbmc/gcc_builtin_sub_overflow/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ void check_long(void)
void check_long_long(void)
{
long result;
assert(!__builtin_ssubl_overflow(1ll, 1ll, &result));
assert(!__builtin_ssubll_overflow(1ll, 1ll, &result));
assert(result == 0ll);
assert(__builtin_ssubl_overflow(LLONG_MIN, 1ll, &result));
assert(!__builtin_ssubl_overflow(LLONG_MIN / 2ll, LLONG_MAX / 2ll, &result));
assert(__builtin_ssubll_overflow(LLONG_MIN, 1ll, &result));
assert(!__builtin_ssubll_overflow(LLONG_MIN / 2ll, LLONG_MAX / 2ll, &result));
assert(result - 1ll == LLONG_MIN);
assert(0 && "reachability");
}
Expand Down
6 changes: 3 additions & 3 deletions regression/cbmc/gcc_builtin_sub_overflow/test.desc
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ main.c
\[check_long.assertion.4\] line \d+ assertion !__builtin_ssubl_overflow\(.* / 2l, .* / 2l, &result\): SUCCESS
\[check_long.assertion.5\] line \d+ assertion result - 1l == .*: SUCCESS
\[check_long.assertion.6\] line \d+ assertion 0 && "reachability": FAILURE
\[check_long_long.assertion.1\] line \d+ assertion !__builtin_ssubl_overflow\(1ll, 1ll, &result\): SUCCESS
\[check_long_long.assertion.1\] line \d+ assertion !__builtin_ssubll_overflow\(1ll, 1ll, &result\): SUCCESS
\[check_long_long.assertion.2\] line \d+ assertion result == 0ll: SUCCESS
\[check_long_long.assertion.3\] line \d+ assertion __builtin_ssubl_overflow\(.*, 1ll, &result\): SUCCESS
\[check_long_long.assertion.4\] line \d+ assertion !__builtin_ssubl_overflow\(.* / 2ll, .* / 2ll, &result\): SUCCESS
\[check_long_long.assertion.3\] line \d+ assertion __builtin_ssubll_overflow\(.*, 1ll, &result\): SUCCESS
\[check_long_long.assertion.4\] line \d+ assertion !__builtin_ssubll_overflow\(.* / 2ll, .* / 2ll, &result\): SUCCESS
\[check_long_long.assertion.5\] line \d+ assertion result - 1ll == .*: SUCCESS
\[check_long_long.assertion.6\] line \d+ assertion 0 && "reachability": FAILURE
\[check_unsigned.assertion.1\] line \d+ assertion !__builtin_usub_overflow\(1u, 1u, &result\): SUCCESS
Expand Down

0 comments on commit afe88cf

Please sign in to comment.