view gcc/testsuite/c-c++-common/gomp/pr70550-2.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* PR middle-end/70550 */
/* { dg-do compile } */
/* { dg-additional-options "-Wuninitialized" } */

void bar (int);

void
foo (void)
{
  int i, j, k, l, m, n, o, p, q;
  #pragma omp task				/* { dg-bogus "is used uninitialized in this function" } */
  {
    i = 2;
    bar (i);
  }
  #pragma omp taskloop				/* { dg-bogus "is used uninitialized in this function" } */
  for (j = 0; j < 10; j++)
    {
      k = 7;
      bar (k);
    }
  #pragma omp task firstprivate (l)		/* { dg-warning "is used uninitialized in this function" } */
  {
    l = 2;
    bar (l);
  }
  #pragma omp taskloop firstprivate (m)		/* { dg-warning "is used uninitialized in this function" } */
  for (j = 0; j < 10; j++)
    {
      m = 7;
      bar (m);
    }
  #pragma omp task shared (n)			/* { dg-bogus "is used uninitialized in this function" } */
  {
    n = 2;
    bar (n);
  }
  #pragma omp taskloop shared (o)		/* { dg-bogus "is used uninitialized in this function" } */
  for (j = 0; j < 10; j++)
    {
      o = 7;
      bar (o);
    }
  #pragma omp task private (p)			/* { dg-bogus "is used uninitialized in this function" } */
  {
    p = 2;
    bar (p);
  }
  #pragma omp taskloop shared (q)		/* { dg-bogus "is used uninitialized in this function" } */
  for (j = 0; j < 10; j++)
    {
      q = 7;
      bar (q);
    }
}