view gcc/testsuite/c-c++-common/Wparentheses-1.c @ 16:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

/* PR c/70436 */
/* { dg-do compile } */
/* { dg-options "-Wparentheses" } */

int a, b, c[101], d[101], e[101], f[101];

void
f1 (void)
{
  int i;

  if (a) /* { dg-warning "ambiguous" } */
    #pragma GCC ivdep
    for (i = 0; i < 100; i++)
      if (b)
	c[i] = d[i] + e[i];
      else
	f[i] = d[i] * e[i];

  if (a)
    #pragma GCC ivdep
    for (i = 0; i < 100; i++)
      {
	if (b)
	  c[i] = d[i] + e[i];
	else
	  f[i] = d[i] * e[i];
      }

  if (a)
    #pragma GCC ivdep
    for (i = 0; i < 100; i++)
      {
	if (b)
	  c[i] = d[i] + e[i];
      }
  else
    f[i] = d[i] * e[i];
}