source: examples/Initialization2.c @ a254fa56

ADTarm-ehast-experimentalenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprpthread-emulationqualifiedEnum
Last change on this file since a254fa56 was bf71cfd, checked in by Thierry Delisle <tdelisle@…>, 6 years ago

Moved up many directories in source

  • 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.