File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
regression/goto-instrument/nondet-volatile-01 Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
3+ void main ()
4+ {
5+ int a [2 ] = {0 };
6+
7+ volatile int i = 0 ;
8+ a [i ] = 1 ;
9+
10+ assert (a [1 ] == 0 ); // should fail
11+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ test.c
3+ --nondet-volatile
4+ ^EXIT=10$
5+ ^SIGNAL=0$
6+ --
7+ --
8+ Check that volatile variables appearing in the lhs of an assignment are
9+ correctly treated as nondet
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ void nondet_volatile(
8888 if (instruction.is_assign ())
8989 {
9090 nondet_volatile_rhs (symbol_table, to_code_assign (instruction.code ).rhs ());
91- nondet_volatile_lhs (symbol_table, to_code_assign (instruction.code ).rhs ());
91+ nondet_volatile_lhs (symbol_table, to_code_assign (instruction.code ).lhs ());
9292 }
9393 else if (instruction.is_function_call ())
9494 {
You can’t perform that action at this time.
0 commit comments