Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.brendan/ctors1.C

raw
1 // { dg-do run }
2 // GROUPS passed constructors
3 // Check that global level object constructors get called.
4
5 extern "C" int printf (const char *, ...);
6
7 struct base {
8 int f1;
9 int f2;
10 base (int arg1, int arg2);
11 };
12
13
14 base global_base(0x55, 0xff);
15
16 int main ()
17 {
18 if ((global_base.f1 != 0x55) || (global_base.f2 != 0xff))
19 { printf ("FAIL\n"); return 1; }
20 else
21 printf ("PASS\n");
22 }
23
24 base::base(int arg1, int arg2)
25 {
26 f1 = arg1;
27 f2 = arg2;
28 }