Skip to content

Commit 66959cb

Browse files
committed
Fix copy&paste error: check_long_long should check __builtin_ssubll_overflow
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).
1 parent 261f598 commit 66959cb

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

regression/cbmc/gcc_builtin_sub_overflow/main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ void check_long(void)
2626
void check_long_long(void)
2727
{
2828
long result;
29-
assert(!__builtin_ssubl_overflow(1ll, 1ll, &result));
29+
assert(!__builtin_ssubll_overflow(1ll, 1ll, &result));
3030
assert(result == 0ll);
31-
assert(__builtin_ssubl_overflow(LLONG_MIN, 1ll, &result));
32-
assert(!__builtin_ssubl_overflow(LLONG_MIN / 2ll, LLONG_MAX / 2ll, &result));
31+
assert(__builtin_ssubll_overflow(LLONG_MIN, 1ll, &result));
32+
assert(!__builtin_ssubll_overflow(LLONG_MIN / 2ll, LLONG_MAX / 2ll, &result));
3333
assert(result - 1ll == LLONG_MIN);
3434
assert(0 && "reachability");
3535
}

regression/cbmc/gcc_builtin_sub_overflow/test.desc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ main.c
1313
\[check_long.assertion.4\] line \d+ assertion !__builtin_ssubl_overflow\(.* / 2l, .* / 2l, &result\): SUCCESS
1414
\[check_long.assertion.5\] line \d+ assertion result - 1l == .*: SUCCESS
1515
\[check_long.assertion.6\] line \d+ assertion 0 && "reachability": FAILURE
16-
\[check_long_long.assertion.1\] line \d+ assertion !__builtin_ssubl_overflow\(1ll, 1ll, &result\): SUCCESS
16+
\[check_long_long.assertion.1\] line \d+ assertion !__builtin_ssubll_overflow\(1ll, 1ll, &result\): SUCCESS
1717
\[check_long_long.assertion.2\] line \d+ assertion result == 0ll: SUCCESS
18-
\[check_long_long.assertion.3\] line \d+ assertion __builtin_ssubl_overflow\(.*, 1ll, &result\): SUCCESS
19-
\[check_long_long.assertion.4\] line \d+ assertion !__builtin_ssubl_overflow\(.* / 2ll, .* / 2ll, &result\): SUCCESS
18+
\[check_long_long.assertion.3\] line \d+ assertion __builtin_ssubll_overflow\(.*, 1ll, &result\): SUCCESS
19+
\[check_long_long.assertion.4\] line \d+ assertion !__builtin_ssubll_overflow\(.* / 2ll, .* / 2ll, &result\): SUCCESS
2020
\[check_long_long.assertion.5\] line \d+ assertion result - 1ll == .*: SUCCESS
2121
\[check_long_long.assertion.6\] line \d+ assertion 0 && "reachability": FAILURE
2222
\[check_unsigned.assertion.1\] line \d+ assertion !__builtin_usub_overflow\(1u, 1u, &result\): SUCCESS

0 commit comments

Comments
 (0)