view gcc/testsuite/gcc.c-torture/execute/packed-aligned.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

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;
}