File tree Expand file tree Collapse file tree 4 files changed +31
-3
lines changed
validate-trace-xml-schema
src/ansi-c/goto-conversion Expand file tree Collapse file tree 4 files changed +31
-3
lines changed Original file line number Diff line number Diff line change 1+ int foo ()
2+ {
3+ return 1 ;
4+ }
5+
6+ int main ()
7+ {
8+ if (foo ())
9+ goto out ;
10+
11+ return 1 ;
12+
13+ out :
14+ __CPROVER_assert (0 , "false" );
15+ return 0 ;
16+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ no-duplicate-decl.c
3+ --show-goto-functions
4+ ^[[:space:]]*DECL main::\$tmp::return_value_foo
5+ ^EXIT=0$
6+ ^SIGNAL=0$
7+ --
8+ ^[[:space:]]*DECL going_to::out
9+ ^[[:space:]]*\d+: DECL main::\$tmp::return_value_foo
10+ --
11+ Test that no loop back to the declaration is generated.
Original file line number Diff line number Diff line change 2323 ['xml-interface1' , 'test_wrong_flag.desc' ],
2424 # these want --show-goto-functions instead of producing a trace
2525 ['integer-assignments1' , 'integer-typecheck.desc' ],
26+ ['declaration-goto' , 'no-duplicate-decl.desc' ],
2627 ['destructors' , 'compound_literal.desc' ],
2728 ['destructors' , 'enter_lexical_block.desc' ],
2829 ['enum_is_in_range' , 'enum_test3-simplified.desc' ],
Original file line number Diff line number Diff line change @@ -1597,6 +1597,9 @@ void goto_convertt::convert_ifthenelse(
15971597 return convert_ifthenelse (new_if0, dest, mode);
15981598 }
15991599
1600+ exprt tmp_guard = code.cond ();
1601+ clean_expr (tmp_guard, dest, mode);
1602+
16001603 // convert 'then'-branch
16011604 goto_programt tmp_then;
16021605 convert (code.then_case (), tmp_then, mode);
@@ -1616,9 +1619,6 @@ void goto_convertt::convert_ifthenelse(
16161619 : code.else_case ().source_location ();
16171620 }
16181621
1619- exprt tmp_guard = code.cond ();
1620- clean_expr (tmp_guard, dest, mode);
1621-
16221622 generate_ifthenelse (
16231623 tmp_guard,
16241624 source_location,
You can’t perform that action at this time.
0 commit comments