view gcc/testsuite/c-c++-common/gomp/lastprivate-conditional-5.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents
children
line wrap: on
line source

/* { dg-do compile } */
/* { dg-options "-O2 -fopenmp -fdump-tree-ompexp" } */
/* { dg-final { scan-tree-dump-times "GOMP_loop_start " 3 "ompexp" } } */
/* { dg-final { scan-tree-dump-times "GOMP_loop_end_nowait " 3 "ompexp" } } */

int r;

void
foo (int *a)
{
  #pragma omp for nowait lastprivate(conditional: r)
  for (int i = 0; i < 64; ++i)
    if (a[i])
      r = a[i];
}

void
bar (int *a)
{
  #pragma omp for nowait lastprivate(conditional: r) schedule (static, 4)
  for (int i = 0; i < 64; ++i)
    if (a[i])
      r = a[i];
}

void
baz (int *a)
{
  #pragma omp for nowait lastprivate(conditional: r) schedule (runtime)
  for (int i = 0; i < 64; ++i)
    if (a[i])
      r = a[i];
}