view gcc/testsuite/gcc.dg/pr81979.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +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;
}