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 @@ -2872,12 +2872,13 @@ exprt c_typecheck_baset::do_special_functions(
28722872
28732873 return std::move (infl_expr);
28742874 }
2875- else if (identifier==CPROVER_PREFIX " abs" ||
2876- identifier==CPROVER_PREFIX " labs" ||
2877- identifier==CPROVER_PREFIX " llabs" ||
2878- identifier==CPROVER_PREFIX " fabs" ||
2879- identifier==CPROVER_PREFIX " fabsf" ||
2880- identifier==CPROVER_PREFIX " fabsl" )
2875+ else if (
2876+ identifier == CPROVER_PREFIX " abs" || identifier == CPROVER_PREFIX " labs" ||
2877+ identifier == CPROVER_PREFIX " llabs" ||
2878+ identifier == CPROVER_PREFIX " imaxabs" ||
2879+ identifier == CPROVER_PREFIX " fabs" ||
2880+ identifier == CPROVER_PREFIX " fabsf" ||
2881+ identifier == CPROVER_PREFIX " fabsl" )
28812882 {
28822883 if (expr.arguments ().size ()!=1 )
28832884 {
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