- added an example to test suite - the "warning: assignment discards qualifiers from pointer target type" is present but harmless
Showing the changes to tests (1 of 2 files). Show all
Unified · Split
| @@ -827,6 +827,27 @@ struct aligntest4 { · 826 unmodified lines | |||
| 827 | double a[0]; | 827 | double a[0]; |
| 828 | }; | 828 | }; |
| 829 | 829 | ||
| 830 | struct complexinit0 { | ||
| 831 | int a; | ||
| 832 | int b; | ||
| 833 | }; | ||
| 834 | |||
| 835 | struct complexinit { | ||
| 836 | int a; | ||
| 837 | struct complexinit0 *b; | ||
| 838 | }; | ||
| 839 | |||
| 840 | const static struct complexinit cix[] = { | ||
| 841 | [0] = { | ||
| 842 | .a = 0xfefa, | ||
| 843 | .b = (const struct complexinit0[]) { | ||
| 844 | { 0x80, 0x81 }, | ||
| 845 | { 0x82, 0x83 }, | ||
| 846 | {} | ||
| 847 | } | ||
| 848 | } | ||
| 849 | }; | ||
| 850 | |||
| 830 | void struct_test() | 851 | void struct_test() |
| 831 | { | 852 | { |
| 832 | struct1 *s; | 853 | struct1 *s; |
| @@ -856,6 +877,11 @@ void struct_test() · 23 unmodified lines | |||
| 856 | printf("st2: %d %d %d\n", | 877 | printf("st2: %d %d %d\n", |
| 857 | s->f1, s->f2, s->f3); | 878 | s->f1, s->f2, s->f3); |
| 858 | printf("str_addr=%x\n", (int)st1.str - (int)&st1.f1); | 879 | printf("str_addr=%x\n", (int)st1.str - (int)&st1.f1); |
| 880 | printf("cix: %d %d %d %d %d %d %d\n", | ||
| 881 | cix[0].a, | ||
| 882 | cix[0].b[0].a, cix[0].b[0].b, | ||
| 883 | cix[0].b[1].a, cix[0].b[1].b, | ||
| 884 | cix[0].b[2].a, cix[0].b[2].b); | ||
| 859 | 885 | ||
| 860 | /* align / size tests */ | 886 | /* align / size tests */ |
| 861 | printf("aligntest1 sizeof=%d alignof=%d\n", | 887 | printf("aligntest1 sizeof=%d alignof=%d\n", |