https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93510

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
If I get this right,
extern void abort (void);
extern int random ();

int
main ()
{
  int a[1024];
  for (int x = 0; x < 1024; x++)
    a[x] = 1 + (random () & 1);
  int d, h;
  for (int x = 0; x < 1024; x += 16)
    {
      d = 1;
      #pragma omp target teams distribute defaultmap(tofrom:scalar) \
                  reduction(*:d)
      for (int y = 0; y < 16; y++)
        d *= a[x + y];
      h = 1;
      for (int y = 0; y < 16; y++)
        h *= a[x + y];
      if (d != h)
        abort ();
    }
  return 0;
}

as the testcase translated from Fortran to C doesn't FAIL even with nvptx
offloading.

Reply via email to