blob: 84dd634d9cff6b67c3a05dcaca93bcc98be9aa8f (
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
30
31
32
33
34
35
36
37
38
39
40
|
// GROUPS passed code-generation
// Check that sub-word sized structs/classes are passed correctly
// if the struct/class has a constructor (i.e. ANY constructor).
extern "C" void printf (char *, ...);
struct base {
unsigned int f1 : 8;
unsigned int f2 : 8;
base (int ii)
{
}
};
base global_base (7);
int test2 (base formal_base);
int main ()
{
global_base.f1 = 0x55;
global_base.f2 = 0xee;
if (test2 (global_base) == 0)
printf ("PASS\n");
else
printf ("FAIL\n");
return 0;
}
int test2 (base formal_base)
{
if (formal_base.f1 != global_base.f1)
return -1;
if (formal_base.f2 != global_base.f2)
return -1;
return 0;
}
|