summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/zerolen-1.c
blob: 632ad4bc09e85dac06031d93be0d706039074de9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
extern void abort (void);
extern void exit (int);

union iso_directory_record {
   char carr[4];
   struct {
           unsigned char name_len [1];
           char name [0];
   } u;
} entry;

void set(union iso_directory_record *);

int main (void)
{
   union iso_directory_record *de;

   de = &entry;
   set(de);

   if (de->u.name_len[0] == 1 && de->u.name[0] == 0)
     exit (0);
   else
     abort ();
}

void set (union iso_directory_record *p)
{
   p->carr[0] = 1;
   p->carr[1] = 0;
   return;
}