1 /* { dg-do run } */
2
3 typedef struct { unsigned int num; } info_t;
4 typedef struct { unsigned int flag, type; } block_t;
5 info_t info;
6 block_t blocks[] = { {2,0}, {3,0}, {1,0}, {1,0} };
7
8 static block_t *
9 f (info_t *i, block_t *b)
10 {
11 while (1) {
12 unsigned int is_last = b->flag & 0x01;
13 i->num++;
14 if (b->flag & 0x02) {
15 if (b->type != 0x1) b->type = b->type;
16 b = f (i, b+1);
17 }
18 if (is_last)
19 break;
20 b++;
21 }
22 return b;
23 }
24
25 int
26 main ()
27 {
28 f(&info, &blocks[0]);
29 if (info.num != 4)
30 __builtin_abort ();
31 return 0;
32 }