File tree 3 files changed +26
-0
lines changed
regression/goto-instrument/assert1
3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include <assert.h>
2
+
3
+ int main (int argc , char * argv [])
4
+ {
5
+ assert (0 );
6
+ return 0 ;
7
+ }
Original file line number Diff line number Diff line change
1
+ CORE
2
+ main.c
3
+ --dump-c
4
+ ^EXIT=10$
5
+ ^SIGNAL=0$
6
+ --
7
+ ^warning: ignoring
8
+ ^[[:space:]]*IF
Original file line number Diff line number Diff line change 26
26
27
27
#include " goto_convert_class.h"
28
28
#include " destructor.h"
29
+ #include " remove_skip.h"
29
30
30
31
static bool is_empty (const goto_programt &goto_program)
31
32
{
@@ -1825,6 +1826,11 @@ void goto_convertt::generate_ifthenelse(
1825
1826
true_case.instructions .back ().guard =boolean_negate (guard);
1826
1827
dest.destructive_append (true_case);
1827
1828
true_case.instructions .clear ();
1829
+ if (
1830
+ is_empty (false_case) ||
1831
+ (is_size_one (false_case) &&
1832
+ is_skip (false_case, false_case.instructions .begin ())))
1833
+ return ;
1828
1834
}
1829
1835
1830
1836
// similarly, do guarded assertions directly
@@ -1838,6 +1844,11 @@ void goto_convertt::generate_ifthenelse(
1838
1844
false_case.instructions .back ().guard =guard;
1839
1845
dest.destructive_append (false_case);
1840
1846
false_case.instructions .clear ();
1847
+ if (
1848
+ is_empty (true_case) ||
1849
+ (is_size_one (true_case) &&
1850
+ is_skip (true_case, true_case.instructions .begin ())))
1851
+ return ;
1841
1852
}
1842
1853
1843
1854
// Flip around if no 'true' case code.
You can’t perform that action at this time.
0 commit comments