Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.old-deja / g++.brendan / code-gen1.C
bloba8c9aba3645134cbd799b2b6cee60fd18cdbbf2a
1 // { dg-do run  }
2 // GROUPS passed code-generation
3 // Check that sub-word sized structs/classes are passed correctly
4 // if the struct/class has a constructor (i.e. ANY constructor).
6 extern "C" int printf (const char *, ...); 
8 struct base {
9         unsigned int f1 : 8;
10         unsigned int f2 : 8;
12         base (int ii)
13         {
14         }
17 base global_base (7);
19 int test2 (base formal_base);
21 int main ()
23         global_base.f1 = 0x55;
24         global_base.f2 = 0xee;
26         if (test2 (global_base) == 0)
27           printf ("PASS\n");
28         else
29           { printf ("FAIL\n"); return 1; }
31         return 0;
34 int test2 (base formal_base)
36         if (formal_base.f1 != global_base.f1)
37                 return -1;
38         if (formal_base.f2 != global_base.f2)
39                 return -1;
40         return 0;