aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/packed-aligned.c
blob: f768af0ab024f19f207611ad5b55d1b13dc51ec1 (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
struct c {
  double a;
} __attribute((packed)) __attribute((aligned));

extern void abort(void);

double g_expect = 32.25;

void f(unsigned x, struct c y)
{
  if (x != 0)
    abort();

  if (y.a != g_expect)
    abort();
}

struct c e = { 64.25 };

int main(void)
{
  struct c d = { 32.25 };
  f(0, d);

  g_expect = 64.25;
  f(0, e);
  return 0;
}