From afe88cf8a451bf702d184486915cc8e740670249 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Sat, 23 Jan 2021 00:55:21 +0000 Subject: [PATCH] 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). --- regression/cbmc/gcc_builtin_sub_overflow/main.c | 6 +++--- regression/cbmc/gcc_builtin_sub_overflow/test.desc | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/regression/cbmc/gcc_builtin_sub_overflow/main.c b/regression/cbmc/gcc_builtin_sub_overflow/main.c index 091e19d2a47..667f1ef0497 100644 --- a/regression/cbmc/gcc_builtin_sub_overflow/main.c +++ b/regression/cbmc/gcc_builtin_sub_overflow/main.c @@ -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"); } diff --git a/regression/cbmc/gcc_builtin_sub_overflow/test.desc b/regression/cbmc/gcc_builtin_sub_overflow/test.desc index 8dadd397961..4034a477c82 100644 --- a/regression/cbmc/gcc_builtin_sub_overflow/test.desc +++ b/regression/cbmc/gcc_builtin_sub_overflow/test.desc @@ -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