File tree 4 files changed +40
-6
lines changed
regression/cbmc-library/imaxabs-01
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(
2944
2944
2945
2945
return std::move (infl_expr);
2946
2946
}
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" )
2953
2954
{
2954
2955
if (expr.arguments ().size ()!=1 )
2955
2956
{
Original file line number Diff line number Diff line change @@ -25,6 +25,22 @@ long long int llabs(long long int i)
25
25
return __CPROVER_llabs (i );
26
26
}
27
27
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
+
28
44
/* FUNCTION: __builtin_abs */
29
45
30
46
int __builtin_abs (int i )
You can’t perform that action at this time.
0 commit comments