blob: 80ce93039f299a58638782e407848aeb87db3f22 (
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
41
42
43
44
45
46
|
// APPLE LOCAL file test of -mdynamic-no-pic combined with 68k alignment
// Radar 3242139: Positive C++ test case
// Origin: Matt Austern <austern@apple.com>
// { dg-do run }
// { dg-options "-mdynamic-no-pic" }
const long val1 = 0xa0b0;
const long val2 = 0x1234;
#pragma options align=mac68k
struct X {
long x1;
long x2;
};
#pragma options align=reset
void setX(X* x) {
x->x1 = val1;
x->x2 = val2;
}
struct Y
{
X field;
void set_vals();
};
void Y::set_vals()
{
::setX(&field);
}
int main()
{
Y y;
bool ok = true;
y.field.x1 = y.field.x2 = 0;
ok = ok && y.field.x1 == 0 && y.field.x2 == 0;
y.set_vals();
ok = ok && y.field.x1 == val1 && y.field.x2 == val2;
return !ok;
}
|