view gcc/testsuite/c-c++-common/gomp/clauses-3.c @ 111:04ced10e8804

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

struct T { int a; int *b; };
struct S { int *s; char u; struct T v; long x; };

void bar (int *);
#pragma omp declare target to (bar)

int
main ()
{
  int a[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  struct S s = { a, 5, { 6, a + 5 }, 99L };
  #pragma omp target map (s.v.a, s.u, s.x)
  ;
  #pragma omp target map (s.v.a, s.u, s.x)
  bar (&s.v.a);
  #pragma omp target map (s.v.a) map (always, to: s.u) map (s.x)
  ;
  #pragma omp target map (s.s[0]) map (s.v.b[:3])
  ;
  #pragma omp target map (s.s[0]) map (s.v.b[:3])
  bar (s.s);
  return 0;
}