diff test/strinit.c @ 542:492f06738550

working... (struct init fix)
author kono
date Sun, 01 Jan 2006 18:49:07 +0900
parents a379da780856
children 9defd9459016
line wrap: on
line diff
--- a/test/strinit.c	Sun Jan 01 12:25:08 2006 +0900
+++ b/test/strinit.c	Sun Jan 01 18:49:07 2006 +0900
@@ -7,6 +7,10 @@
    int b;
    int c;
    int d;
+    struct hoge {
+	int k;
+	int j;
+    } m;
    int e;
 } temp1 = {
 //   101,
@@ -24,19 +28,32 @@
    .a = (int)b
 };
 
+struct temp temp4 = { 1,2,3,4,5,6,7};
+struct temp temp7 = { 1,2,3,4,{5,6},7};
 
 
+int
 main()
 {
     struct temp temp2 = { .c = 5, .e=99 };
-    printf("#0031:1: %d\n",temp1.a);
-    printf("#0032:1: %d\n",temp1.e);
-    printf("#0033:1: %d\n",temp1.b);
-    printf("#0034:2: %d\n",temp2.c);
-    printf("#0035:2: %d\n",temp2.e);
-    printf("#0036:2: %d\n",temp2.b);
-    printf("#0037:2: %d\n",(void*)temp3.c==b);
-    printf("#0038:2: %d\n",temp3.c==(int)b);
-    printf("#0039:2: %d\n",temp3.a==(int)&b);
+#ifdef WRONG
+    struct temp temp5 = { 1,2,3,4,5,6,7,8};
+    struct temp temp6 = { 1,2,3,4,5,6};
+#else
+    struct temp temp5 = { 1,2,3,4,5,6,7};
+    struct temp temp6 = { 1,2,3,4,5,6,7};
+    struct temp temp8 = { 1,2,3,4,{5,6},7};
+#endif
+    printf("#0042:1: %d\n",temp1.a);
+    printf("#0043:1: %d\n",temp1.e);
+    printf("#0044:1: %d\n",temp1.b);
+    printf("#0045:2: %d\n",temp2.c);
+    printf("#0046:2: %d\n",temp2.e);
+    printf("#0047:2: %d\n",temp2.b);
+    printf("#0048:2: %d\n",(void*)temp3.c==b);
+    printf("#0049:2: %d\n",temp3.c==(int)b);
+    printf("#0050:2: %d\n",temp3.a==(int)&b);
+    printf("#0051:2: %d\n",temp4.m.j);
+    printf("#0051:2: %d\n",temp5.m.j);
     return 0;
 }