File tree Expand file tree Collapse file tree 9 files changed +54
-83
lines changed Expand file tree Collapse file tree 9 files changed +54
-83
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+ #include <math.h>
3+
4+ float g = - INFINITY ;
5+
6+ void test_static_float_infinity ()
7+ {
8+ static float f = + INFINITY ;
9+ assert (isinf (f ));
10+ }
11+
12+ void test_static_double_infinity ()
13+ {
14+ static double d = INFINITY ;
15+ assert (isinf (d ));
16+ }
17+
18+ void test_static_long_double_infinity ()
19+ {
20+ static long double ld = INFINITY ;
21+ assert (isinf (ld ));
22+ }
23+
24+ void test_static_huge_val ()
25+ {
26+ static float f = HUGE_VALF ;
27+ static double d = HUGE_VAL ;
28+ static long double ld = HUGE_VALL ;
29+
30+ assert (isinf (f ));
31+ assert (isinf (d ));
32+ assert (isinf (ld ));
33+ }
34+
35+ int main ()
36+ {
37+ test_static_float_infinity ();
38+ test_static_double_infinity ();
39+ test_static_long_double_infinity ();
40+ test_static_huge_val ();
41+ return 0 ;
42+ }
Original file line number Diff line number Diff line change 1- KNOWNBUG
2- main .c
3- --pointer-check --bounds-check
1+ CORE
2+ static_init .c
3+
44^EXIT=0$
55^SIGNAL=0$
66^VERIFICATION SUCCESSFUL$
Original file line number Diff line number Diff line change @@ -3265,8 +3265,9 @@ exprt c_typecheck_baset::do_special_functions(
32653265
32663266 return typecast_exprt::conditional_cast (isfinite_expr, expr.type ());
32673267 }
3268- else if (identifier==CPROVER_PREFIX " inf" ||
3269- identifier==" __builtin_inf" )
3268+ else if (
3269+ identifier == CPROVER_PREFIX " inf" || identifier == " __builtin_inf" ||
3270+ identifier == " __builtin_huge_val" )
32703271 {
32713272 constant_exprt inf_expr=
32723273 ieee_floatt::plus_infinity (
@@ -3275,7 +3276,9 @@ exprt c_typecheck_baset::do_special_functions(
32753276
32763277 return std::move (inf_expr);
32773278 }
3278- else if (identifier==CPROVER_PREFIX " inff" )
3279+ else if (
3280+ identifier == CPROVER_PREFIX " inff" || identifier == " __builtin_inff" ||
3281+ identifier == " __builtin_huge_valf" )
32793282 {
32803283 constant_exprt inff_expr=
32813284 ieee_floatt::plus_infinity (
@@ -3284,7 +3287,9 @@ exprt c_typecheck_baset::do_special_functions(
32843287
32853288 return std::move (inff_expr);
32863289 }
3287- else if (identifier==CPROVER_PREFIX " infl" )
3290+ else if (
3291+ identifier == CPROVER_PREFIX " infl" || identifier == " __builtin_infl" ||
3292+ identifier == " __builtin_huge_vall" )
32883293 {
32893294 floatbv_typet type=to_floatbv_type (long_double_type ());
32903295 constant_exprt infl_expr=
Original file line number Diff line number Diff line change @@ -216,39 +216,6 @@ int __isnormalf(float f)
216216 return __CPROVER_isnormalf (f );
217217}
218218
219- /* FUNCTION: __builtin_inff */
220-
221- float __builtin_inff (void )
222- {
223- #pragma CPROVER check push
224- #pragma CPROVER check disable "float-div-by-zero"
225- #pragma CPROVER check disable "float-overflow"
226- return 1.0f / 0.0f ;
227- #pragma CPROVER check pop
228- }
229-
230- /* FUNCTION: __builtin_inf */
231-
232- double __builtin_inf (void )
233- {
234- #pragma CPROVER check push
235- #pragma CPROVER check disable "float-div-by-zero"
236- #pragma CPROVER check disable "float-overflow"
237- return 1.0 / 0.0 ;
238- #pragma CPROVER check pop
239- }
240-
241- /* FUNCTION: __builtin_infl */
242-
243- long double __builtin_infl (void )
244- {
245- #pragma CPROVER check push
246- #pragma CPROVER check disable "float-div-by-zero"
247- #pragma CPROVER check disable "float-overflow"
248- return 1.0l / 0.0l ;
249- #pragma CPROVER check pop
250- }
251-
252219/* FUNCTION: __builtin_isinf */
253220
254221int __builtin_isinf (double d )
You can’t perform that action at this time.
0 commit comments