OSDN Git Service

Initial revision
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.law / bit-fields2.C
1 // GROUPS passed bit-fields
2 // bitfield file
3 // Message-Id: <92Oct29.191913est.62@jarvis.csri.toronto.edu>
4 // From: mdivax1!robinson@ai.mit.edu (Jim Robinson)
5 // Subject: gcc 2.2.2 C++ bug in handling :0 bit fields
6 // Date:   Thu, 29 Oct 1992 19:18:28 -0500
7 //
8 // Also applies to:
9 // bitfield file
10 // From: Jaimie Wilson/MSL <Jaimie_Wilson@msl.isis.org>
11 // Date:   Fri, 28 Jan 1994 06:11:43 -0500
12 // Subject: GCC bug report
13
14
15 #include <stdio.h>
16 #include <stddef.h>
17
18 struct foo {
19         char a;
20         char b;
21         unsigned int : 0;       /* force word alignment */
22         char c;
23 };
24
25 int
26 main(int argc, char **argv)
27 {
28         struct foo bar;
29
30         if (offsetof (struct foo, c) > sizeof (unsigned int))
31                 printf ("FAIL\n");
32         else
33                 printf ("PASS\n");
34         return 0;
35 }
36