aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.old-deja/g++.brendan/ctors2.C
blob: c30ab7010a4289a21f36d5113a70cfd1f6ecf01d (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
// { dg-do run  }
// GROUPS passed constructors
// Check that sub-words sized class members are correctly set
// by constructors.

extern "C" int printf (const char *, ...); 

struct base {
	int f1 : 8;
	int f2 : 8;
	base (int arg1, int arg2);
};


base global_base(0x55, 0x7e);

int main ()
{
	if ((global_base.f1 != 0x55) || (global_base.f2 != 0x7e))
	  { printf ("FAIL\n"); return 1; }
	else
	  printf ("PASS\n");
}

base::base(int arg1, int arg2)
{
	f1 = arg1;
	f2 = arg2;
}