File tree Expand file tree Collapse file tree 4 files changed +38
-0
lines changed
regression/goto-instrument Expand file tree Collapse file tree 4 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ elif echo $args | grep -q -- "--dump-c-type-header" ; then
3838 cat " ${name} -mod.gb"
3939 mv " ${name} .gb" " ${name} -mod.gb"
4040elif echo $args | grep -q -- " --dump-c" ; then
41+ cat " ${name} -mod.gb"
4142 mv " ${name} -mod.gb" " ${name} -mod.c"
4243
4344 if [[ " ${is_windows} " == " true" ]]; then
Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
3+ struct S
4+ {
5+ const int x ;
6+ const int y : 8 ;
7+ const int * const p ;
8+ };
9+
10+ int foo ()
11+ {
12+ return 1 ;
13+ }
14+
15+ int main ()
16+ {
17+ struct S s1 = {foo (), 1 , 0 };
18+ assert (s1 .x == 1 );
19+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --dump-c
4+ signed int x
5+ signed int y
6+ const signed int \*p
7+ ^[[:space:]]*s1 = \(struct S\)\{ .* \};
8+ ^EXIT=0$
9+ ^SIGNAL=0$
10+ --
11+ const signed int x
12+ const signed int y
13+ const p
14+ --
15+ This test demonstrates that the constness of struct members has been removed,
16+ which is necessary as the initialisation is not performed in the declaration.
Original file line number Diff line number Diff line change @@ -1591,6 +1591,8 @@ void goto_program2codet::remove_const(typet &type)
15911591 ++it)
15921592 remove_const (it->type ());
15931593 }
1594+ else if (type.id () == ID_c_bit_field)
1595+ to_c_bit_field_type (type).subtype ().remove (ID_C_constant);
15941596}
15951597
15961598static bool has_labels (const codet &code)
You can’t perform that action at this time.
0 commit comments