view gcc/testsuite/gcc.dg/20030805-1.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

/* Test that gcc understands that the call to g might clobber i.  */

/* { dg-do run } */
/* { dg-options "-O2 -fgnu89-inline" } */

__inline int f ()
{
  static int i;
  int i2 = i;
  i = i2 + 1;
  return i;
}

int g () { return f (); }

int main ()
{
  if (f() != 1
      || g() != 2
      || f() != 3)
    return 1;
  return 0;
}