view gcc/testsuite/gcc.dg/pr81979.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* PR target/81979 */
/* { dg-do link } */
/* { dg-options "-O2 -w" } */
/* { dg-additional-options "-fPIC" { target fpic } } */
/* { dg-additional-options "-freorder-blocks-and-partition" { target freorder } } */

int d;

__attribute__((noinline, noclone)) void
foo (int x)
{
  int c;
  while (c < 1)
    {
      int o;
      for (o = 0; o < 4; ++o)
	c /= (x != 0) ? 2 : x;
    }

  d = 1;
  for (;;)
    ;
}

int
main ()
{
  asm volatile ("" : : "r" (&d) : "memory");
  foo (d);
  asm volatile ("" : : "r" (&d) : "memory");
  return 0;
}