view gcc/testsuite/gcc.dg/torture/pr57359-1.c @ 19:2b5abeee2509 default tip

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

/* { dg-do run } */

extern void abort();

typedef int A;
typedef float B;

void __attribute__((noinline,noclone))
foo(A *p, B *q, long unk)
{
  for (long i = 0; i < unk; ++i) {
      *p = 1;
      q[i] = 42;
  }
}

int main(void)
{
  union { A x; B f; } u;
  foo(&u.x, &u.f, 1);
  if (u.f != 42) abort();
  return 0;
}