diff options
Diffstat (limited to 'test/regression/struct7.c')
-rw-r--r-- | test/regression/struct7.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/test/regression/struct7.c b/test/regression/struct7.c index 136602bf..fe3ef827 100644 --- a/test/regression/struct7.c +++ b/test/regression/struct7.c @@ -29,8 +29,8 @@ union u2 D; int main() { - struct small A2; - struct big B2; + struct small A1, A2, AA[1]; + struct big B1, B2; union u1 C2; union u2 D2; int i; @@ -42,10 +42,18 @@ int main() printf("A2 = { %d, %f, { '%c', ... , '%c' } }\n", A2.x, A2.d, A2.c[0], A2.c[4]); + A2 = (A1 = A); + printf("A2 = { %d, %f, { '%c', ... , '%c' } }\n", + A2.x, A2.d, A2.c[0], A2.c[4]); + B2 = B; printf("B2 = { %d, ..., %d, ..., %d }\n", B2.x[0], B2.x[4], B2.x[99]); + B2 = (B1 = B); + printf("B2 = { %d, ..., %d, ..., %d }\n", + B2.x[0], B2.x[4], B2.x[99]); + C2 = C; printf("C2.c = '%c'\n", C2.c); @@ -53,6 +61,14 @@ int main() printf("D2.v = { %d, ..., %d, ..., %d }\n", D2.v.x[0], D2.v.x[4], D2.v.x[99]); + AA[0] = A; + A1.x = 0; + A2.x = 0; + AA[A1.x] = AA[A2.x]; + + printf("AA[0] = { %d, %f, { '%c', ... , '%c' } }\n", + AA[0].x, AA[0].d, AA[0].c[0], AA[0].c[4]); + return 0; } |