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
{
@@ -1723,6 +1724,11 @@ void goto_convertt::generate_ifthenelse(
1723
1724
true_case.instructions .back ().guard =boolean_negate (guard);
1724
1725
dest.destructive_append (true_case);
1725
1726
true_case.instructions .clear ();
1727
+ if (
1728
+ is_empty (false_case) ||
1729
+ (is_size_one (false_case) &&
1730
+ is_skip (false_case, false_case.instructions .begin ())))
1731
+ return ;
1726
1732
}
1727
1733
1728
1734
// similarly, do guarded assertions directly
@@ -1736,6 +1742,11 @@ void goto_convertt::generate_ifthenelse(
1736
1742
false_case.instructions .back ().guard =guard;
1737
1743
dest.destructive_append (false_case);
1738
1744
false_case.instructions .clear ();
1745
+ if (
1746
+ is_empty (true_case) ||
1747
+ (is_size_one (true_case) &&
1748
+ is_skip (true_case, true_case.instructions .begin ())))
1749
+ return ;
1739
1750
}
1740
1751
1741
1752
// Flip around if no 'true' case code.
You can’t perform that action at this time.
0 commit comments