source: src/examples/Initialization2.c @ 759908f

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resndemanglerenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newwith_gc
Last change on this file since 759908f was ca26509, checked in by Peter A. Buhr <pabuhr@…>, 8 years ago

relocate and delete example programs under Test directory to test/examples directories

  • Property mode set to 100644
File size: 862 bytes
Line 
1int a = 3;
2struct { int x; int y; } z = { 3, 7 };      /* OK */
3struct { int x; int y; } z1 = { .[x,y]:3 }; /* OK */
4struct { int x; int y; } z2 = { y:3, x:4 }; /* OK */
5struct { int x; struct { int y1; int y2; } y; } z3 = { x:3, y:{y1:4, y2:5} };  /* OK */
6struct { int x; struct { int y1; int y2; } y; } z3 = { y:{y2:9, y1:8}, x:7 };  /* OK */
7struct { int x; struct { int y1; int y2; } y; } z3 = { x:7, {y2:9, y1:8} };  /* OK */
8struct { int x; struct { int y1; int y2; } y; } z3 = { 3, {4, 5} };   /* OK */
9//struct { int x; struct { int y1; int y2; } } z3 = {4, {5,6}};
10//struct { int x; struct { int y1; int y2; } y; } z4 = { y:{4,5}, a:3 };
11//struct { int x; struct { int y1; int y2; } y; } z5 = { a:3, {4,5}};
12//int x[20] = { [10]: 4 };
13struct t { int a, b; };
14struct t x = { b:4, a:3 };
15struct { int x; int y; } z6= {5,6,4};  /* (should be an) error */
Note: See TracBrowser for help on using the repository browser.