struct-init: Implement initializing subaggregates

E.g. "struct { struct S s; int a;} = { others, 42 };"
if 'others' is also a 'struct S'.  Also when the value is a
compound literal.  See added testcases.
This commit is contained in:
Michael Matz
2016-07-31 05:43:17 +02:00
parent 968bccdd2a
commit ed7d54651d
4 changed files with 226 additions and 40 deletions

View File

@ -54,7 +54,7 @@ all test: $(filter-out $(SKIP),$(TESTS))
# automatically generate .expect files with gcc:
%.expect :
(gcc $*.c -o a.exe && ./a.exe $(ARGS)) >$*.expect 2>&1; rm -f a.exe
(gcc -w $*.c -o a.exe && ./a.exe $(ARGS)) >$*.expect 2>&1; rm -f a.exe
# tell make not to delete
.PRECIOUS: %.expect