2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / bit-fields2.C
blob43f30f4ca628ae1d124bc018e247ffed254d0e17
1 // { dg-do run  }
2 // GROUPS passed bit-fields
3 // bitfield file
4 // Message-Id: <92Oct29.191913est.62@jarvis.csri.toronto.edu>
5 // From: mdivax1!robinson@ai.mit.edu (Jim Robinson)
6 // Subject: gcc 2.2.2 C++ bug in handling :0 bit fields
7 // Date:   Thu, 29 Oct 1992 19:18:28 -0500
8 //
9 // Also applies to:
10 // bitfield file
11 // From: Jaimie Wilson/MSL <Jaimie_Wilson@msl.isis.org>
12 // Date:   Fri, 28 Jan 1994 06:11:43 -0500
13 // Subject: GCC bug report
15 // This test is only meant for targets where EMPTY_FIELD_BOUNDARY is
16 // defined to no larger than the size of an unsigned int, or where
17 // PCC_BITFIELD_TYPE_MATTERS is defined.  Add skips below for targets that
18 // do not have that property.
19 // Skip if target: mmix-knuth-mmixware
22 #include <stdio.h>
23 #include <stddef.h>
25 struct foo {
26         char a;
27         char b;
28         unsigned int : 0;       /* force word alignment */
29         char c;
32 int
33 main(int argc, char **argv)
35         struct foo bar;
37         if (offsetof (struct foo, c) > sizeof (unsigned int))
38                 { printf ("FAIL\n"); return 1; }
39         else
40                 printf ("PASS\n");
41         return 0;