view gcc/testsuite/c-c++-common/Wduplicated-branches-11.c @ 19:2b5abeee2509 default tip

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

/* PR c/64279 */
/* { dg-do compile } */
/* { dg-options "-Wduplicated-branches" } */

int
f (int p)
{
  if (p == 0)
    {
      p += 1, ++p;
    }
  else
    {
      p -= 1, ++p;
    }

  if (p == 1)
    {
    }
  else
    p++;

  if (p == 2)
    p++;
  else
    {
    }

  if (p == 3)
    {
    }
  else
    {
    }

  if (p == 4)
    {
      ++p;
      return p;
    }
  else
    {
      p++;
      return p;
    }

  if (p == 5)
    ++p;
  else
    p++;

  if (p == 6)
    {
      ++p;
      ++p;
      return p;
    }
  else
    {
      ++p;
      return p;
    }

  if (p == 7)
    {
      ++p;
      return p;
    }
  else
    {
      ++p;
      ++p;
      return p;
    }
}