2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.brendan / ctors2.C
blobc30ab7010a4289a21f36d5113a70cfd1f6ecf01d
1 // { dg-do run  }
2 // GROUPS passed constructors
3 // Check that sub-words sized class members are correctly set
4 // by constructors.
6 extern "C" int printf (const char *, ...); 
8 struct base {
9         int f1 : 8;
10         int f2 : 8;
11         base (int arg1, int arg2);
15 base global_base(0x55, 0x7e);
17 int main ()
19         if ((global_base.f1 != 0x55) || (global_base.f2 != 0x7e))
20           { printf ("FAIL\n"); return 1; }
21         else
22           printf ("PASS\n");
25 base::base(int arg1, int arg2)
27         f1 = arg1;
28         f2 = arg2;