scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

0241-init.c (461B)


      1 struct a {
      2 	int i;
      3 	char s[10];
      4 };
      5 
      6 int i = 3;
      7 
      8 int
      9 main(void)
     10 {
     11 	char *s;
     12 	struct a b = {i, "hola"};
     13 
     14 	s = b.s;
     15 	if (s[0] != 'h')
     16 		return 1;
     17 	if (s[1] != 'o')
     18 		return 2;
     19 	if (s[2] != 'l')
     20 		return 3;
     21 	if (s[3] != 'a')
     22 		return 4;
     23 	if (s[4] != '\0')
     24 		return 5;
     25 	if (s[5] != '\0')
     26 		return 6;
     27 	if (s[6] != '\0')
     28 		return 7;
     29 	if (s[7] != '\0')
     30 		return 8;
     31 	if (s[8] != '\0')
     32 		return 9;
     33 	if (s[9] != '\0')
     34 		return 10;
     35 	if (b.i != 3)
     36 		return 11;
     37 	return 0;
     38 }