File tree Expand file tree Collapse file tree 4 files changed +40
-6
lines changed
regression/cbmc-library/imaxabs-01 Expand file tree Collapse file tree 4 files changed +40
-6
lines changed Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+ #include <inttypes.h>
3+ #include <stdlib.h>
4+
5+ int main ()
6+ {
7+ assert (imaxabs (INTMAX_MIN + 1 ) == INTMAX_MAX );
8+ return 0 ;
9+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --pointer-check --bounds-check --signed-overflow-check
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^VERIFICATION SUCCESSFUL$
7+ --
8+ ^warning: ignoring
Original file line number Diff line number Diff line change @@ -2944,12 +2944,13 @@ exprt c_typecheck_baset::do_special_functions(
29442944
29452945 return std::move (infl_expr);
29462946 }
2947- else if (identifier==CPROVER_PREFIX " abs" ||
2948- identifier==CPROVER_PREFIX " labs" ||
2949- identifier==CPROVER_PREFIX " llabs" ||
2950- identifier==CPROVER_PREFIX " fabs" ||
2951- identifier==CPROVER_PREFIX " fabsf" ||
2952- identifier==CPROVER_PREFIX " fabsl" )
2947+ else if (
2948+ identifier == CPROVER_PREFIX " abs" || identifier == CPROVER_PREFIX " labs" ||
2949+ identifier == CPROVER_PREFIX " llabs" ||
2950+ identifier == CPROVER_PREFIX " imaxabs" ||
2951+ identifier == CPROVER_PREFIX " fabs" ||
2952+ identifier == CPROVER_PREFIX " fabsf" ||
2953+ identifier == CPROVER_PREFIX " fabsl" )
29532954 {
29542955 if (expr.arguments ().size ()!=1 )
29552956 {
Original file line number Diff line number Diff line change @@ -25,6 +25,22 @@ long long int llabs(long long int i)
2525 return __CPROVER_llabs (i );
2626}
2727
28+ /* FUNCTION: imaxabs */
29+
30+ #ifndef __CPROVER_INTTYPES_H_INCLUDED
31+ # include <inttypes.h>
32+ # define __CPROVER_INTTYPES_H_INCLUDED
33+ #endif
34+
35+ #undef imaxabs
36+
37+ intmax_t __CPROVER_imaxabs (intmax_t );
38+
39+ intmax_t imaxabs (intmax_t i )
40+ {
41+ return __CPROVER_imaxabs (i );
42+ }
43+
2844/* FUNCTION: __builtin_abs */
2945
3046int __builtin_abs (int i )
You can’t perform that action at this time.
0 commit comments