File tree Expand file tree Collapse file tree 2 files changed +11
-12
lines changed
regression/cbmc/gcc_builtin_add_overflow Expand file tree Collapse file tree 2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,8 @@ void check_unsigned_long_long(void)
92
92
assert (0 && "reachability" );
93
93
}
94
94
95
- void check_generic (void ) {
95
+ void check_generic (void )
96
+ {
96
97
unsigned char small_result ;
97
98
signed long long big_result ;
98
99
assert (!__builtin_add_overflow (17 , 25 , & small_result ));
@@ -104,7 +105,8 @@ void check_generic(void) {
104
105
assert (big_result == 345 );
105
106
assert (!__builtin_add_overflow (INT_MAX , INT_MAX , & big_result ));
106
107
assert (big_result == 2ll * INT_MAX );
107
- assert (__builtin_add_overflow (LLONG_MAX /2 + 1 , LLONG_MAX /2 + 1 , & big_result ));
108
+ assert (
109
+ __builtin_add_overflow (LLONG_MAX / 2 + 1 , LLONG_MAX / 2 + 1 , & big_result ));
108
110
assert (0 && "reachability" );
109
111
}
110
112
Original file line number Diff line number Diff line change @@ -2808,20 +2808,17 @@ exprt c_typecheck_baset::do_special_functions(
2808
2808
identifier == " __builtin_sub_overflow" ||
2809
2809
identifier == " __builtin_mul_overflow" )
2810
2810
{
2811
- if (expr.arguments ().size () != 3 ) {
2811
+ if (expr.arguments ().size () != 3 )
2812
+ {
2812
2813
std::ostringstream error_message;
2813
- error_message
2814
- << expr.source_location ().as_string ()
2815
- << " : "
2816
- << identifier
2817
- << " takes exactly 3 arguments, but "
2818
- << expr.arguments ().size ()
2819
- << " were provided"
2820
- ;
2814
+ error_message << expr.source_location ().as_string () << " : " << identifier
2815
+ << " takes exactly 3 arguments, but "
2816
+ << expr.arguments ().size () << " were provided" ;
2821
2817
throw invalid_source_file_exceptiont{error_message.str ()};
2822
2818
}
2823
2819
2824
- for (std::size_t arg_index = 0 ; arg_index < 3 ; ++arg_index) {
2820
+ for (std::size_t arg_index = 0 ; arg_index < 3 ; ++arg_index)
2821
+ {
2825
2822
auto const &argument = expr.arguments ()[arg_index];
2826
2823
bool const arg_has_correct_type =
2827
2824
(arg_index < 2 ) ? (argument.type ().id () == ID_signedbv ||
You can’t perform that action at this time.
0 commit comments