1 /* Test for new block scopes in C99. Test for each new scope. */
2 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
4 /* { dg-options "-std=iso9899:1999 -pedantic-errors" } */
6 extern void abort (void);
7 extern void exit (int);
12 struct foo
{ int i0
; };
14 a
= sizeof (struct foo
);
15 if (b
= sizeof (struct foo
{ int i0
; int i1
; }))
16 c
= sizeof (struct foo
{ int i0
; int i1
; int i2
; });
17 if (!(a
<= b
&& b
<= c
))
19 if ((b
= sizeof (struct foo
{ int i0
; int i1
; })), 0)
20 c
= sizeof (struct foo
{ int i0
; int i1
; int i2
; });
22 d
= sizeof (struct foo
{ int i0
; int i1
; int i2
; int i3
; });
23 if (!(a
<= b
&& b
<= d
))
25 switch (b
= sizeof (struct foo
{ int i0
; int i1
; }))
27 c
= sizeof (struct foo
{ int i0
; int i1
; int i2
; });
28 if (!(a
<= b
&& b
<= c
))
31 c
= sizeof (struct foo
{ int i0
; int i1
; int i2
; });
32 while ((b
= sizeof (struct foo
{ int i0
; int i1
; })), 0);
33 if (!(a
<= b
&& b
<= c
))
36 while ((b
= sizeof (struct foo
{ int i0
; int i1
; })), d
)
37 (c
= sizeof (struct foo
{ int i0
; int i1
; int i2
; })), d
--;
38 if (!(a
<= b
&& b
<= c
))
41 for ((b
= sizeof (struct foo
{ int i0
; int i1
; })); d
; d
--)
42 c
= sizeof (struct foo
{ int i0
; int i1
; int i2
; });
43 if (!(a
<= b
&& b
<= c
))
46 for ((b
= sizeof (struct foo
{ int i0
; int i1
; })); d
; d
--)
47 c
= sizeof (struct foo
);
48 if (!(a
<= b
&& b
== c
))
51 for (; (b
= sizeof (struct foo
{ int i0
; int i1
; })), d
; d
--)
52 c
= sizeof (struct foo
{ int i0
; int i1
; int i2
; });
53 if (!(a
<= b
&& b
<= c
))
56 for (; (b
= sizeof (struct foo
{ int i0
; int i1
; })), d
; d
--)
57 c
= sizeof (struct foo
);
58 if (!(a
<= b
&& b
== c
))
61 for (; d
; (b
= sizeof (struct foo
{ int i0
; int i1
; })), d
--)
62 c
= sizeof (struct foo
{ int i0
; int i1
; int i2
; });
63 if (!(a
<= b
&& b
<= c
))
66 for (; d
; (b
= sizeof (struct foo
{ int i0
; int i1
; })), d
--)
67 c
= sizeof (struct foo
);
68 if (!(a
<= b
&& b
== c
))