1 /* Test for multiple declarations and composite types. Includes bug
3 /* Origin: Joseph Myers <jsm@polyomino.org.uk> */
4 /* { dg-do compile } */
5 /* { dg-options "-g" } */
10 /* Test all combinations of: a variable declared at file scope (no
11 type specifiers, or extern, or static), or just inside a function
12 (with extern), redeclared in an inner scope (with extern), and
13 redeclared in an inner scope when the previous declaration is
14 hidden (with extern, and not if the original declaration was
15 static). Test three times: incomplete variable types; pointers to
16 incomplete types; functions returning such pointers. */
22 sizeof(a0
); /* { dg-error "incomplete" } */
25 sizeof(a0
); /* { dg-error "incomplete" } */
30 sizeof(a0
); /* { dg-error "incomplete" } */
33 sizeof(a0
); /* { dg-error "incomplete" } */
35 sizeof(a0
); /* { dg-error "incomplete" } */
43 sizeof(a1
); /* { dg-error "incomplete" } */
46 sizeof(a1
); /* { dg-error "incomplete" } */
54 sizeof(a1
); /* { dg-error "incomplete" } */
56 sizeof(a1
); /* { dg-error "incomplete" } */
64 sizeof(a2
); /* { dg-error "incomplete" } */
72 sizeof(a2
); /* { dg-error "incomplete" } */
77 sizeof(a2
); /* { dg-error "incomplete" } */
85 sizeof(a3
); /* { dg-error "incomplete" } */
98 sizeof(a3
); /* { dg-error "incomplete" } */
114 sizeof(a4
); /* { dg-error "incomplete" } */
156 sizeof(a6
); /* { dg-error "incomplete" } */
190 sizeof(a8
); /* { dg-error "incomplete" } */
193 sizeof(a8
); /* { dg-error "incomplete" } */
198 sizeof(a8
); /* { dg-error "incomplete" } */
201 sizeof(a8
); /* { dg-error "incomplete" } */
203 sizeof(a8
); /* { dg-error "incomplete" } */
211 sizeof(a9
); /* { dg-error "incomplete" } */
214 sizeof(a9
); /* { dg-error "incomplete" } */
222 sizeof(a9
); /* { dg-error "incomplete" } */
224 sizeof(a9
); /* { dg-error "incomplete" } */
232 sizeof(a10
); /* { dg-error "incomplete" } */
240 sizeof(a10
); /* { dg-error "incomplete" } */
245 sizeof(a10
); /* { dg-error "incomplete" } */
253 sizeof(a11
); /* { dg-error "incomplete" } */
266 sizeof(a11
); /* { dg-error "incomplete" } */
282 sizeof(a12
); /* { dg-error "incomplete" } */
324 sizeof(a14
); /* { dg-error "incomplete" } */
358 sizeof(a16
); /* { dg-error "incomplete" } */
361 sizeof(a16
); /* { dg-error "incomplete" } */
363 sizeof(a16
); /* { dg-error "incomplete" } */
371 sizeof(a17
); /* { dg-error "incomplete" } */
376 sizeof(a17
); /* { dg-error "incomplete" } */
410 sizeof(*b0
); /* { dg-error "incomplete" } */
413 sizeof(*b0
); /* { dg-error "incomplete" } */
418 sizeof(*b0
); /* { dg-error "incomplete" } */
421 sizeof(*b0
); /* { dg-error "incomplete" } */
423 sizeof(*b0
); /* { dg-error "incomplete" } */
431 sizeof(*b1
); /* { dg-error "incomplete" } */
434 sizeof(*b1
); /* { dg-error "incomplete" } */
442 sizeof(*b1
); /* { dg-error "incomplete" } */
444 sizeof(*b1
); /* { dg-error "incomplete" } */
452 sizeof(*b2
); /* { dg-error "incomplete" } */
460 sizeof(*b2
); /* { dg-error "incomplete" } */
465 sizeof(*b2
); /* { dg-error "incomplete" } */
473 sizeof(*b3
); /* { dg-error "incomplete" } */
486 sizeof(*b3
); /* { dg-error "incomplete" } */
502 sizeof(*b4
); /* { dg-error "incomplete" } */
544 sizeof(*b6
); /* { dg-error "incomplete" } */
578 sizeof(*b8
); /* { dg-error "incomplete" } */
581 sizeof(*b8
); /* { dg-error "incomplete" } */
586 sizeof(*b8
); /* { dg-error "incomplete" } */
589 sizeof(*b8
); /* { dg-error "incomplete" } */
591 sizeof(*b8
); /* { dg-error "incomplete" } */
599 sizeof(*b9
); /* { dg-error "incomplete" } */
602 sizeof(*b9
); /* { dg-error "incomplete" } */
610 sizeof(*b9
); /* { dg-error "incomplete" } */
612 sizeof(*b9
); /* { dg-error "incomplete" } */
620 sizeof(*b10
); /* { dg-error "incomplete" } */
628 sizeof(*b10
); /* { dg-error "incomplete" } */
633 sizeof(*b10
); /* { dg-error "incomplete" } */
641 sizeof(*b11
); /* { dg-error "incomplete" } */
654 sizeof(*b11
); /* { dg-error "incomplete" } */
670 sizeof(*b12
); /* { dg-error "incomplete" } */
712 sizeof(*b14
); /* { dg-error "incomplete" } */
746 sizeof(*b16
); /* { dg-error "incomplete" } */
749 sizeof(*b16
); /* { dg-error "incomplete" } */
751 sizeof(*b16
); /* { dg-error "incomplete" } */
759 sizeof(*b17
); /* { dg-error "incomplete" } */
764 sizeof(*b17
); /* { dg-error "incomplete" } */
798 sizeof(*c0()); /* { dg-error "incomplete" } */
800 extern IA
*c0 (void);
801 sizeof(*c0()); /* { dg-error "incomplete" } */
805 extern IA
*c0 (void);
806 sizeof(*c0()); /* { dg-error "incomplete" } */
809 sizeof(*c0()); /* { dg-error "incomplete" } */
811 sizeof(*c0()); /* { dg-error "incomplete" } */
813 A10
*c0 (void) { return 0; }
819 sizeof(*c1()); /* { dg-error "incomplete" } */
821 extern IA
*c1 (void);
822 sizeof(*c1()); /* { dg-error "incomplete" } */
826 extern A10
*c1 (void);
830 sizeof(*c1()); /* { dg-error "incomplete" } */
832 sizeof(*c1()); /* { dg-error "incomplete" } */
834 A10
*c1 (void) { return 0; }
840 sizeof(*c2()); /* { dg-error "incomplete" } */
842 extern A10
*c2 (void);
847 extern IA
*c2 (void);
848 sizeof(*c2()); /* { dg-error "incomplete" } */
853 sizeof(*c2()); /* { dg-error "incomplete" } */
855 A10
*c2 (void) { return 0; }
861 sizeof(*c3()); /* { dg-error "incomplete" } */
863 extern A10
*c3 (void);
868 extern A10
*c3 (void);
874 sizeof(*c3()); /* { dg-error "incomplete" } */
876 A10
*c3 (void) { return 0; }
884 extern IA
*c4 (void);
889 extern IA
*c4 (void);
890 sizeof(*c4()); /* { dg-error "incomplete" } */
897 A10
*c4 (void) { return 0; }
905 extern IA
*c5 (void);
910 extern A10
*c5 (void);
918 A10
*c5 (void) { return 0; }
926 extern A10
*c6 (void);
931 extern IA
*c6 (void);
932 sizeof(*c6()); /* { dg-error "incomplete" } */
939 A10
*c6 (void) { return 0; }
947 extern A10
*c7 (void);
952 extern A10
*c7 (void);
960 A10
*c7 (void) { return 0; }
962 extern IA
*c8 (void);
966 sizeof(*c8()); /* { dg-error "incomplete" } */
968 extern IA
*c8 (void);
969 sizeof(*c8()); /* { dg-error "incomplete" } */
973 extern IA
*c8 (void);
974 sizeof(*c8()); /* { dg-error "incomplete" } */
977 sizeof(*c8()); /* { dg-error "incomplete" } */
979 sizeof(*c8()); /* { dg-error "incomplete" } */
981 extern A10
*c8 (void) { return 0; }
983 extern IA
*c9 (void);
987 sizeof(*c9()); /* { dg-error "incomplete" } */
989 extern IA
*c9 (void);
990 sizeof(*c9()); /* { dg-error "incomplete" } */
994 extern A10
*c9 (void);
998 sizeof(*c9()); /* { dg-error "incomplete" } */
1000 sizeof(*c9()); /* { dg-error "incomplete" } */
1002 extern A10
*c9 (void) { return 0; }
1004 extern IA
*c10 (void);
1008 sizeof(*c10()); /* { dg-error "incomplete" } */
1010 extern A10
*c10 (void);
1015 extern IA
*c10 (void);
1016 sizeof(*c10()); /* { dg-error "incomplete" } */
1021 sizeof(*c10()); /* { dg-error "incomplete" } */
1023 extern A10
*c10 (void) { return 0; }
1025 extern IA
*c11 (void);
1029 sizeof(*c11()); /* { dg-error "incomplete" } */
1031 extern A10
*c11 (void);
1036 extern A10
*c11 (void);
1042 sizeof(*c11()); /* { dg-error "incomplete" } */
1044 extern A10
*c11 (void) { return 0; }
1046 extern A10
*c12 (void);
1052 extern IA
*c12 (void);
1057 extern IA
*c12 (void);
1058 sizeof(*c12()); /* { dg-error "incomplete" } */
1065 extern A10
*c12 (void) { return 0; }
1067 extern A10
*c13 (void);
1073 extern IA
*c13 (void);
1078 extern A10
*c13 (void);
1086 extern A10
*c13 (void) { return 0; }
1088 extern A10
*c14 (void);
1094 extern A10
*c14 (void);
1099 extern IA
*c14 (void);
1100 sizeof(*c14()); /* { dg-error "incomplete" } */
1107 extern A10
*c14 (void) { return 0; }
1109 extern A10
*c15 (void);
1115 extern A10
*c15 (void);
1120 extern A10
*c15 (void);
1128 extern A10
*c15 (void) { return 0; }
1130 static IA
*c16 (void);
1134 sizeof(*c16()); /* { dg-error "incomplete" } */
1136 extern IA
*c16 (void);
1137 sizeof(*c16()); /* { dg-error "incomplete" } */
1139 sizeof(*c16()); /* { dg-error "incomplete" } */
1141 static A10
*c16 (void) { return 0; }
1143 static IA
*c17 (void);
1147 sizeof(*c17()); /* { dg-error "incomplete" } */
1149 extern A10
*c17 (void);
1152 sizeof(*c17()); /* { dg-error "incomplete" } */
1154 static A10
*c17 (void) { return 0; }
1156 static A10
*c18 (void);
1162 extern IA
*c18 (void);
1167 static A10
*c18 (void) { return 0; }
1169 static A10
*c19 (void);
1175 extern A10
*c19 (void);
1180 static A10
*c19 (void) { return 0; }